Browse Source

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

jinsy 7 years ago
parent
commit
f5841615fc
75 changed files with 1578 additions and 1113 deletions
  1. 34 6
      README.md
  2. 0 9
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java
  3. 3 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/ExcelController.java
  4. 0 2
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/CommonMapper.java
  5. 3 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java
  6. 1 4
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java
  7. 6 2
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java
  8. 48 36
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  9. 0 3
      applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml
  10. 1 1
      applications/commons/commons-server/src/main/resources/mapper/DataImportDetailMapper.xml
  11. 2 2
      applications/commons/commons-server/src/main/resources/mapper/DataImportMapper.xml
  12. 1 1
      applications/commons/commons-server/src/main/resources/mapper/DataTempletMapper.xml
  13. 6 2
      applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml
  14. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java
  15. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  16. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  17. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  18. 3 0
      applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml
  19. 15 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  20. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustomerCheckViewMapper.java
  21. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendorAcountViewMapper.java
  22. 11 10
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  23. 6 7
      applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml
  24. 6 7
      applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml
  25. 1 1
      applications/sale/sale-server/src/main/resources/config/application-docker-test.yml
  26. 11 1
      framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java
  27. 35 50
      frontend/saas-web/app.json
  28. 5 0
      frontend/saas-web/app/view/core/base/ImportWindow.js
  29. 1 1
      frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js
  30. 1 1
      frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js
  31. 2 64
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  32. 23 8
      frontend/saas-web/app/view/core/report/ReportPanel.js
  33. 42 0
      frontend/saas-web/app/view/document/address/DataList.js
  34. 48 0
      frontend/saas-web/app/view/document/address/DataListModel.js
  35. 32 0
      frontend/saas-web/app/view/document/address/Window.js
  36. 82 0
      frontend/saas-web/app/view/document/bankinformation/DataList.js
  37. 54 0
      frontend/saas-web/app/view/document/bankinformation/DataListModel.js
  38. 128 0
      frontend/saas-web/app/view/document/bankinformation/Window.js
  39. 94 0
      frontend/saas-web/app/view/document/employee/DataList.js
  40. 51 0
      frontend/saas-web/app/view/document/employee/DataListModel.js
  41. 123 0
      frontend/saas-web/app/view/document/employee/Window.js
  42. 1 209
      frontend/saas-web/app/view/document/kind/ChildForm.js
  43. 0 200
      frontend/saas-web/app/view/document/kind/Kind.js
  44. 1 1
      frontend/saas-web/app/view/document/kind/KindController.js
  45. 0 247
      frontend/saas-web/app/view/document/kind/KindModel.js
  46. 0 30
      frontend/saas-web/app/view/document/other/Address.js
  47. 0 31
      frontend/saas-web/app/view/document/other/BankInformation.js
  48. 0 28
      frontend/saas-web/app/view/document/other/Employee.js
  49. 0 30
      frontend/saas-web/app/view/document/other/ProductBrand.js
  50. 0 30
      frontend/saas-web/app/view/document/other/ProductUnit.js
  51. 0 28
      frontend/saas-web/app/view/document/other/Warehouse.js
  52. 4 8
      frontend/saas-web/app/view/document/product/FormPanel.js
  53. 42 0
      frontend/saas-web/app/view/document/productbrand/DataList.js
  54. 48 0
      frontend/saas-web/app/view/document/productbrand/DataListModel.js
  55. 32 0
      frontend/saas-web/app/view/document/productbrand/Window.js
  56. 42 0
      frontend/saas-web/app/view/document/productunit/DataList.js
  57. 48 0
      frontend/saas-web/app/view/document/productunit/DataListModel.js
  58. 32 0
      frontend/saas-web/app/view/document/productunit/Window.js
  59. 94 0
      frontend/saas-web/app/view/document/warehouse/DataList.js
  60. 52 0
      frontend/saas-web/app/view/document/warehouse/DataListModel.js
  61. 121 0
      frontend/saas-web/app/view/document/warehouse/Window.js
  62. 0 1
      frontend/saas-web/app/view/home/InfoCard.scss
  63. 2 5
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  64. 17 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  65. 8 6
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  66. 6 0
      frontend/saas-web/app/view/stock/make/QueryPanel.js
  67. 7 1
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  68. 7 1
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js
  69. 70 6
      frontend/saas-web/app/view/stock/report/DataList.js
  70. 17 4
      frontend/saas-web/app/view/stock/report/DataListController.js
  71. 1 0
      frontend/saas-web/app/view/sys/power/TreePanel.js
  72. 6 2
      frontend/saas-web/ext/packages/ux/src/feature/MySummary.js
  73. 2 2
      frontend/saas-web/overrides/form/field/TrimVtype.js
  74. 3 3
      frontend/saas-web/package.json
  75. 11 16
      frontend/saas-web/resources/json/navigation.json

+ 34 - 6
README.md

@@ -106,13 +106,15 @@
 | 192.168.0.178 |  root  | select123*** |  CentOS7, Docker  | Cpu: 4, Mem: 8G, Disk: 20G |
 | 192.168.0.179 |  root  | select123*** |  CentOS7, Docker  | Cpu: 4, Mem: 8G, Disk: 20G |
 | 192.168.0.180 |  root  | select123*** |  CentOS7, Docker  | Cpu: 4, Mem: 8G, Disk: 20G |
-| 192.168.0.181 |  root  | select123*** |  CentOS7, Docker  | Cpu: 4, Mem: 8G, Disk: 80G |
+| 192.168.0.181 |  root  | select123*** |  CentOS7, Docker  | Cpu: 8, Mem: 16G, Disk: 80G |
 | 192.168.0.182 |  root  | select123*** |  CentOS7, Redis  | Cpu: 2, Mem: 8G, Disk: 20G |
 | 192.168.0.183 |  root  | select123*** |  CentOS7, Mongo  | Cpu: 4, Mem: 8G, Disk: 50G |
+| 192.168.0.184 |  root  | select123*** |  CentOS7, Docker  | Cpu: 8, Mem: 16G, Disk: 50G |
+| 192.168.0.185 |  root  | select123*** |  CentOS7, Docker  | Cpu: 8, Mem: 16G, Disk: 50G |
 
 > 构建
 
-* [jenkins](http://192.168.0.181:8080/job/saas) **账号** admin **密码** select123***
+* [jenkins](http://192.168.0.181:8080/job/saas/view/dev) **账号** admin **密码** select123***
 
 > 日志
 
@@ -123,11 +125,9 @@
 > 服务
 
 * [eureka http://192.168.0.181:8500](http://192.168.0.181:8500) **账号** admin **密码** select111***
-* [eureka 本地调试 http://192.168.0.181:8510](http://192.168.0.181:8510) **账号** admin **密码** select111***
 * [gateway http://192.168.0.181:8560](http://192.168.0.181:8560)
-* [gateway 本地调试 http://192.168.0.181:8570](http://192.168.0.181:8570)
-* [admin](http://192.168.0.181:8520) **账号** admin **密码** select111***
-* [zipkin](http://192.168.0.181:8540) **账号** admin **密码** select111***
+* [admin http://192.168.0.181:8520](http://192.168.0.181:8520) **账号** admin **密码** select111***
+* [zipkin http://192.168.0.181:8540](http://192.168.0.181:8540) **账号** admin **密码** select111***
 
 > 访问
 
@@ -136,6 +136,34 @@
 * [打印 https://saas-report-dev.usoftchina.com:5443](https://saas-report-dev.usoftchina.com:5443)
 * [接口 https://saas-api-dev.usoftchina.com:5443](https://saas-api-dev.usoftchina.com:5443)
 
+# 本地调试环境
+
+> 服务
+
+* [eureka http://192.168.0.181:8510](http://192.168.0.181:8510) **账号** admin **密码** select111***
+* [gateway http://192.168.0.181:8570](http://192.168.0.181:8570)
+
+
+# 测试环境
+
+> 构建
+
+* [jenkins](http://192.168.0.181:8080/job/saas/view/test) **账号** admin **密码** select123***
+
+> 服务
+
+* [eureka http://192.168.0.181:8515](http://192.168.0.181:8515) **账号** admin **密码** select111***
+* [gateway http://192.168.0.181:8575](http://192.168.0.181:8575)
+* [admin http://192.168.0.181:8535](http://192.168.0.181:8535) **账号** admin **密码** select111***
+* [zipkin http://192.168.0.181:8555](http://192.168.0.181:8555) **账号** admin **密码** select111***
+
+> 访问
+
+* [门户 https://saas-test.usoftchina.com:5443](https://saas-test.usoftchina.com:5443)
+* [系统 https://trade-test.usoftchina.com:5443](https://trade-test.usoftchina.com:5443)
+* [打印 https://saas-report-dev.usoftchina.com:5443](https://saas-report-dev.usoftchina.com:5443)
+* [接口 https://saas-api-test.usoftchina.com:5443](https://saas-api-test.usoftchina.com:5443)
+
 # 生产环境
 
 > 数据库

+ 0 - 9
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java

@@ -21,15 +21,6 @@ public class ListReqDTO implements Serializable {
 
     private String calculateFields;
 
-    private String ym;
-
-    public String getYm() {
-        return ym;
-    }
-
-    public void setYm(String ym) {
-        this.ym = ym;
-    }
 
     //将列拼成查询语句,直接查询出数据的格式为json
     public String getCalculateFieldsSql() {

+ 3 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/ExcelController.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.commons.controller;
 import com.usoftchina.saas.auth.client.annotation.IgnoreAuth;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.service.ExcelService;
+import com.usoftchina.saas.utils.DateUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
@@ -15,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.net.URLEncoder;
+import java.util.Date;
 import java.util.Map;
 
 /**导入模板下载、解析
@@ -32,7 +34,7 @@ public class ExcelController {
     public void CreateTemplet(@RequestParam("caller") String caller, HttpServletResponse response) throws IOException {
         Map<String, Object> map = excelService.CreateTemplet(caller);
         SXSSFWorkbook workbook = (SXSSFWorkbook)map.get("workbook");
-        String title = map.get("title").toString();
+        String title = map.get("title").toString() + "_" + DateUtils.format(new Date(), "yyyyMMdd");
         String filename = URLEncoder.encode(title + ".xlsx", "UTF-8");
         response.setContentType("application/vnd.ms-excel");
         response.setHeader("Content-Disposition", "attachment;filename=" + filename);

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

@@ -4,8 +4,6 @@ import org.apache.ibatis.annotations.Param;
 
 public interface CommonMapper {
 
-    int getCountBaseSet(@Param("companyId") Long companyId);
-
     int getCountWarehouse(@Param("companyId") Long companyId);
 
     int getCountProduct(@Param("companyId") Long companyId);

+ 3 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java

@@ -10,7 +10,7 @@ public interface EndProductMapper {
 
     void endProduct(Map<String, Object> map);
 
-    void endFund(Map<String, Object> map);
+    void end(Map<String, Object> map);
 
     String selectPeriod(@Param("companyId") Long companyId);
 
@@ -20,6 +20,8 @@ public interface EndProductMapper {
 
     void updatePeriodStatus(@Param("status") Long status,@Param("period") String period, @Param("companyId") Long companyId);
 
+    void updateRe(@Param("ym") String ym, @Param("companyId") Long companyId);
+
     int checkPay(Long companyId);
     int checkRec(Long companyId);
     void deleteSub(Long companyId);

+ 1 - 4
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java

@@ -23,10 +23,7 @@ public class CommonServiceImpl implements CommonService {
         InitStatusDTO result = new InitStatusDTO();
         int count = 0;
         Long companyId = BaseContextHolder.getCompanyId();
-        count = commonMapper.getCountBaseSet(companyId);
-        if (count > 0){
-            result.setBaseSet(true);
-        }
+        result.setBaseSet(true);
         count = commonMapper.getCountWarehouse(companyId);
         if (count > 0){
             result.setWarehouse(true);

+ 6 - 2
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java

@@ -16,6 +16,7 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.HashMap;
@@ -55,6 +56,7 @@ public class EndProductServiceImpl implements EndProductService {
         return map;
     }
 
+    @Transactional
     @Override
     public String endAccount() {
         String period = endProductMapper.selectPeriod(BaseContextHolder.getCompanyId());
@@ -63,14 +65,15 @@ public class EndProductServiceImpl implements EndProductService {
         map.put("yearMonth", period);
         map.put("companyId", BaseContextHolder.getCompanyId());
         map.put("result", null);
-        endProductMapper.endProduct(map);
-        endProductMapper.endFund(map);
+//        endProductMapper.endProduct(map);
+        endProductMapper.end(map);
         endProductMapper.updatePeriodStatus(99L, period, BaseContextHolder.getCompanyId());
         DocBaseDTO docBaseDTO = generateMsgObj(Long.parseLong(period));
         messageLogService.customizeLog(docBaseDTO, Operation.ENDPRODUCT);
         return String.valueOf(map.get("result"));
     }
 
+    @Transactional
     @Override
     public void unEndAccount() {
         int payc = endProductMapper.checkPay(BaseContextHolder.getCompanyId());
@@ -84,6 +87,7 @@ public class EndProductServiceImpl implements EndProductService {
         if (StringUtils.isEmpty(period)){
             throw new BizException(BizExceptionCode.BIZ_UNENDPRODUCT);
         }else{
+            endProductMapper.updateRe(period, BaseContextHolder.getCompanyId());
             endProductMapper.updatePeriodStatus(0L, period, BaseContextHolder.getCompanyId());
             messageLogService.customizeLog(generateMsgObj(Long.parseLong(period)), Operation.UNENDPRODUCT);
         }

+ 48 - 36
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java

@@ -12,6 +12,7 @@ import com.usoftchina.saas.commons.service.ExcelService;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.StringUtils;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
@@ -45,6 +46,9 @@ public class ExcelServiceImpl implements ExcelService{
         Map<String, Object> map = new HashMap<>();
         SXSSFWorkbook workbook = new SXSSFWorkbook();
         DataTemplet dataTemplet = dataTempletMapper.selectByCaller(caller, companyId);
+        if (null == dataTemplet) {
+            throw new BizException(9876, "没有查询到对应的excel配置");
+        }
         //列
         String cols = dataTemplet.getDt_columns();
         JSONArray array = (JSONArray) JSONArray.parse(cols);
@@ -70,7 +74,6 @@ public class ExcelServiceImpl implements ExcelService{
     }
 
     @Override
-    @Transactional
     public Integer parseTemplet(Workbook wb, String caller) {
         if (wb == null || StringUtils.isEmpty(caller)) {
             throw new BizException(BizExceptionCode.NULL_DATA);
@@ -136,7 +139,6 @@ public class ExcelServiceImpl implements ExcelService{
             StringBuilder err = new StringBuilder();
             JSONArray mains = new JSONArray();
             JSONArray details = new JSONArray();
-            boolean flag = false;
             //数据行循环
             for (int i = 0; i < datas.size(); i++) {
                 Map<String,String> data = datas.get(i);
@@ -177,25 +179,21 @@ public class ExcelServiceImpl implements ExcelService{
                            if (difference) {
                                dd.setDd_codevalue(codeValue);
                                if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
-                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 必填字段未填写! ");
+                                   err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                    break;
                                }
                            }
                            //检测日期类型是否规范
-                           if ("date".equals(set.getType())) {
-                               flag = validateDateFormat(value);
-                               if (!flag) {
-                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 日期格式不正确! ");
+                           if ("date".equals(set.getType()) && !StringUtils.isEmpty(value)) {
+                               value = praseDate(value);
+                               if (null == value) {
+                                   err.append("第" + (i + 3) + "行 " + set.getDescription() + " 日期格式不正确!<br/> ");
                                    break;
                                }
                            }
                            //插入主表数据
                            if (null != mainData) {
-                               if ("true".equals(set.getNecessary())) {
-                                   mainData.put(set.getField(), value);
-                               } else {
-                                   mainData.put(set.getField(), value);
-                               }
+                               mainData.put(set.getField(), value);
                            }
                        }
                        //所有主表数据进行分类
@@ -214,24 +212,20 @@ public class ExcelServiceImpl implements ExcelService{
                            } else {
                                value = data.get(set.getDescription());
                            }
-                           //拼从表数据
-                           if ("true".equals(set.getNecessary())) {
-                               detailData.put(set.getField(), data.get("*" + set.getDescription()));
-                           } else {
-                               detailData.put(set.getField(), data.get(set.getDescription()));
-                           }
-                           if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
-                               err.append("第" + (i + 2) + "行 " + set.getDescription() + " 必填字段未填写! ");
+                           if ("true".equals(set.getNecessary()) && value.equals("")) {
+                               err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                break;
                            }
                            //检测日期类型是否规范
-                           if ("date".equals(set.getType())) {
-                               flag = validateDateFormat(value);
-                               if (!flag) {
-                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 日期格式不正确! ");
+                           if ("date".equals(set.getType()) && !StringUtils.isEmpty(value)) {
+                               value = praseDate(value);
+                               if (null == value) {
+                                   err.append("第" + (i + 3) + "行 " + set.getDescription() + " 日期格式不正确!<br/> ");
                                    break;
                                }
                            }
+                           //拼从表数据
+                           detailData.put(set.getField(), value);
                        }
                        if (detailData.size() > 0) {
                            dd.setDd_codevalue(codeValue);
@@ -257,7 +251,7 @@ public class ExcelServiceImpl implements ExcelService{
         if (StringUtils.isEmpty(date)) {
             return false;
         }
-        String regEx1 = "[0-9]{8}";
+        String regEx1 = "[0-9]{4}/[0-9]{2}/[0-9]{2}";
         String regEX2 = "[0-9]{4}-[0-9]{2}-[0-9]{2}";
         // 编译正则表达式
         Pattern pattern1 = Pattern.compile(regEx1);
@@ -271,6 +265,15 @@ public class ExcelServiceImpl implements ExcelService{
         return flag;
     }
 
+    private String praseDate(String num) {
+        try {
+            Integer days = Integer.valueOf(num);
+            return DateUtils.plusDay(days, "1899-12-30");
+        }catch (Exception e) {
+            return null;
+        }
+    }
+
     //保证先遍历主表
     private List<String> SetToList(Set<String> sets) {
         List<String> list = new ArrayList<>();
@@ -290,6 +293,10 @@ public class ExcelServiceImpl implements ExcelService{
             switch(cell.getCellType()){
                 case Cell.CELL_TYPE_NUMERIC:{
                     cellValue = String.valueOf(cell.getNumericCellValue());
+                    //判断是否为INT类型
+                    if (Double.valueOf(cellValue.toString()).intValue() - Double.valueOf(cellValue.toString()) == 0) {
+                        return cellValue.toString().substring(0, cellValue.toString().indexOf("."));
+                    }
                     break;
                 }
                 case Cell.CELL_TYPE_FORMULA:{
@@ -336,9 +343,10 @@ public class ExcelServiceImpl implements ExcelService{
      */
     private void createWorkbook(SXSSFWorkbook workbook, int sheetIdx, JSONArray cols, JSONArray datas, String remark){
         Sheet sheet = workbook.createSheet("sheet" + sheetIdx);
-        CellStyle style = getCellStyle(workbook);
-        //sheet.autoSizeColumn((short) 2);
-        sheet.createFreezePane(0, 1);// 固定列
+        CellStyle style = getCellStyle(workbook, true);
+        CellStyle detailStyle = getCellStyle(workbook, false);
+        //sheet.autoSizeColumn(2);
+       // sheet.createFreezePane(0, 1);// 固定列
         Cell cell = null;
         int rIdx = 0;
         int cIdx = 0;
@@ -347,8 +355,8 @@ public class ExcelServiceImpl implements ExcelService{
         Row row = null;
         if (remark != null) {
             row = sheet.createRow(rIdx);
-            row.setHeightInPoints((short) 100);
-            sheet.setColumnWidth(cIdx, 1000);
+            row.setHeightInPoints((short) 50);
+            sheet.setColumnWidth(cIdx, 500);
             cell = getCell(sheet, rIdx, cIdx);
             cell.setCellValue(remark);
             sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, cols.size() - 1));
@@ -365,19 +373,23 @@ public class ExcelServiceImpl implements ExcelService{
                 width = (short) (obj.get("width") == null ? 0 : (int)obj.get("width")*35.7);
                 width = width == 0 ? 4000 : width;
                 sheet.setColumnWidth(cIdx, width);
-                sheet.createFreezePane(cols.size() + 1, 2);
+               // sheet.createFreezePane(cols.size() + 1, 2);
                 cell = getCell(sheet, rIdx, cIdx);
                 value = obj.get("description") == null ? value : obj.get("description").toString();
                 if ("true".equals(obj.get("necessary"))) {
                     value = "*" + value;
                 }
-                cell.setCellValue(value);
-                keys.add(String.valueOf(obj.get("description")));
                 if ("date".equals(obj.get("type"))) {
                     short df= workbook.createDataFormat().getFormat("yyyy-MM-dd");
                     style.setDataFormat(df);
                 }
-                cell.setCellStyle(style);
+                if ("main".equals(obj.get("position"))) {
+                    cell.setCellStyle(style);
+                } else {
+                    cell.setCellStyle(detailStyle);
+                }
+                cell.setCellValue(value);
+                keys.add(String.valueOf(obj.get("description")));
                 cIdx++;
                 value = "";
             }
@@ -410,7 +422,7 @@ public class ExcelServiceImpl implements ExcelService{
         }
     }
 
-    private CellStyle getCellStyle(SXSSFWorkbook workbook) {
+    private CellStyle getCellStyle(SXSSFWorkbook workbook, boolean main) {
         CellStyle style = workbook.createCellStyle();
         style.setFillBackgroundColor((short) 18);
         style.setFillPattern(FillPatternType.LEAST_DOTS);
@@ -421,7 +433,7 @@ public class ExcelServiceImpl implements ExcelService{
         style.setFont(font);
         style.setAlignment(HorizontalAlignment.CENTER);
         style.setFillForegroundColor(HSSFColor.GREEN.index);
-        style.setFillBackgroundColor(HSSFColor.PALE_BLUE.index);
+        style.setFillBackgroundColor(main ? HSSFColor.LIGHT_YELLOW.index : HSSFColor.PALE_BLUE.index);
         style.setBorderBottom(BorderStyle.MEDIUM);
         style.setBorderLeft(BorderStyle.MEDIUM);
         style.setBorderRight(BorderStyle.MEDIUM);

+ 0 - 3
applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml

@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.usoftchina.saas.commons.mapper.CommonMapper" >
-    <select id="getCountBaseSet" resultType="int">
-        SELECT COUNT(*) FROM ENTERPRISE WHERE COMPANYID = #{companyId}
-    </select>
     <select id="getCountWarehouse" resultType="int">
         SELECT COUNT(*) FROM WAREHOUSE WHERE COMPANYID=#{companyId} AND WH_STATUSCODE = 'OPEN'
     </select>

+ 1 - 1
applications/commons/commons-server/src/main/resources/mapper/DataImportDetailMapper.xml

@@ -15,7 +15,7 @@
   </resultMap>
 
   <delete id="deleteByIds">
-    delete from data_importdetail where dd_diid in (${ids})
+    delete from data_importdetail where dd_diid in (${value})
   </delete>
 
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImportDetail" >

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

@@ -6,7 +6,7 @@
   il_toformal=0 and il_result is not null
 </delete>
   <delete id="deleteByIds">
-    delete from data_import where di_id in (${ids});
+    delete from data_import where di_id in (${value});
   </delete>
 
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImport" >
@@ -72,7 +72,7 @@
     update data_import
     set
     di_result = #{err},
-    di_success = 0,
+    di_success = 0
     where di_id = #{id}
   </update>
 

+ 1 - 1
applications/commons/commons-server/src/main/resources/mapper/DataTempletMapper.xml

@@ -12,6 +12,6 @@
   </resultMap>
 
   <select id="selectByCaller" resultMap="BaseResultMap">
-    select * from data_Templet where dt_caller=#{caller} and companyid = #{companyid}
+    select * from data_Templet where dt_caller=#{caller}
   </select>
 </mapper>

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

@@ -29,14 +29,18 @@
         CALL SP_ENDPRODUCT(?, ?, ?)
     </select>
 
-    <select id="endFund" parameterMap="spParamMap" statementType="CALLABLE">
-        CALL SP_ENDFUND(?, ?, ?)
+    <select id="end" parameterMap="spParamMap" statementType="CALLABLE">
+        CALL SP_END(?, ?, ?)
     </select>
 
     <update id="updatePeriodStatus" >
         update periodsdetail set pd_status=#{status} where pd_detno=#{period} and companyId=#{companyId}
     </update>
 
+    <update id="updateRe" >
+        UPDATE receivablesdetail SET RD_STATUS=0 WHERE date_format(rd_date, '%Y%m')=#{ym} AND companyid=#{companyId};
+    </update>
+
     <select id="checkPay" parameterType="java.lang.Long" resultType="java.lang.Integer">
         select count(1) from vendor where (ve_id,companyid) in (select pb_vendid,companyid from (
         select pbd_ym,pb_vendid,paybalance.companyid from paybalance,paybalancedetail where pb_id=pbd_pbid and pbd_slkind='期初余额'

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java

@@ -32,4 +32,6 @@ public interface EmployeeMapper extends CommonBaseMapper<Employee> {
     int validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
 
     int validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long id,@Param("companyId") Long companyId);
+
+    List<Employee> selectByName(@Param("name") String name, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -50,4 +50,6 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
     boolean deleteProdIODetailByCode(@Param("code") String code, @Param("companyId") Long companyId);
 
     Long selectIdByCode(@Param("code") String code, @Param("companyId") Long companyId);
+
+    List<ProductReserveCostDTO> selectReserveCostByIgnoreWarehouse(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 13 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -491,6 +491,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return getMapper().getCombo(id,BaseContextHolder.getCompanyId());
     }
 
+    @Autowired
+    private EmployeeMapper employeeMapper;
     @Override
     public void saveToFormal(Integer id, boolean update) {
         if (null == id || "0".equals(id)) {
@@ -511,6 +513,17 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 List<DataImportDetail> data = datas.get(code);
                 DataImportDetail main = dataImportMapper.selectMainBycode(code, id, companyId);
                 CustomerDTO customerDTO = JSONObject.parseObject(main.getDd_maindata(), CustomerDTO.class);
+                //验证业务员
+                if (!StringUtils.isEmpty(customerDTO.getCu_sellername())) {
+                    List<Employee> employees = employeeMapper.selectByName(customerDTO.getCu_sellername(), companyId);
+                    if (null == employees || employees.size() == 0 || StringUtils.isEmpty(employees.get(0))) {
+                        err.append("客户编号为: " + customerDTO.getCu_code() + " 的业务员: "+ customerDTO.getCu_sellername() +" 在系统中不存在,请确认数据是否正确");
+                        break;
+                    }
+                    customerDTO.setCu_sellerid(Integer.valueOf(employees.get(0).getId().toString()));
+                    customerDTO.setCu_sellercode(employees.get(0).getEm_code());
+                    customerDTO.setCu_sellername(employees.get(0).getEm_name());
+                }
                 customerDTO.setCu_status(Status.OPEN.getDisplay());
                 customerDTO.setCu_statuscode(Status.OPEN.name());
                 //编号不存在

+ 6 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -617,7 +617,12 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         if(condition == null){
             condition = "1=1";
         }
-        return getMapper().selectReserveCost(condition, companyId);
+        if ("DETAIL".equals(listReqDTO.getMode())) {
+            return getMapper().selectReserveCost(condition, companyId);
+        } else {
+            return getMapper().selectReserveCostByIgnoreWarehouse(condition, companyId);
+        }
+
     }
 
     private List<ProductDTO> getList(ListReqDTO listReqDTO){

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

@@ -244,5 +244,8 @@
     select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id}  and companyId =#{companyId}
   </select>
 
+  <select id="selectByName" resultMap="BaseResultMap">
+    select * from employee where em_name = #{name} and companyId=#{companyId}
+  </select>
 
 </mapper>

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

@@ -476,6 +476,21 @@
         </where>
         ORDER BY PR_ID DESC
     </select>
+    <select id="selectReserveCostByIgnoreWarehouse" resultMap="ProdReserveCostResultMap">
+        select pr_code,pr_spec,pr_detail,pr_unit,sum(pw_onhand) pw_onhand,sum(pw_amount) pw_amount
+        from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        <where>
+            <if test="con!=null">
+                ${con}
+            </if>
+            <if test="companyId!=null">
+                and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
+                and pw_onhand!=0
+            </if>
+        </where>
+        group by pr_code,pr_spec,pr_detail,pr_unit,pr_id
+        ORDER BY PR_ID DESC
+    </select>
     <select id="getCountFromPurc" resultType="int">
         SELECT COUNT(*) FROM PURCHASEDETAIL
         WHERE PD_PRODID = #{id} AND COMPANYID=#{companyId}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustomerCheckViewMapper.java

@@ -10,6 +10,6 @@ import java.util.List;
 public interface CustomerCheckViewMapper {
     List<CustomerCheckView> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
     String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
-    VendOrCustAdd selectCustAdd(@Param("sl_custid") Integer sl_vendid, @Param("sl_ym") Integer sl_ym, @Param("companyId") Long companyId);
+    VendOrCustAdd selectCustAdd(@Param("sl_custid") Integer sl_custid, @Param("cons") String cons, @Param("companyId") Long companyId);
     Integer getId(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendorAcountViewMapper.java

@@ -9,6 +9,6 @@ import java.util.List;
 public interface VendorAcountViewMapper {
     List<VendorAcountView> selectByCondition(@Param("con")String con, @Param("companyId")Long companyId);
     String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
-    VendOrCustAdd selectVendAdd(@Param("sl_vendid") Integer sl_vendid, @Param("sl_ym") Integer sl_ym, @Param("companyId") Long companyId);
+    VendOrCustAdd selectVendAdd(@Param("sl_vendid") Integer sl_vendid, @Param("cons") String cons, @Param("companyId") Long companyId);
     Integer getId(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 11 - 10
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java

@@ -91,6 +91,7 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         List list = null;
         Long companyId = BaseContextHolder.getCompanyId();
         String con = req.getFinalCondition();
+        String cons = this.getDate(con);
         String calculateFieldsSql = req.getCalculateFieldsSql();
         JSONArray arr = null;
         if (null == con) {
@@ -103,14 +104,12 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             list = vendorAcountViewMapper.selectByCondition(con, companyId);
             if (list.size() >0) {
                 VendorAcountView vendorAcountView = (VendorAcountView) list.get(0);
+                //取时间
+
                 Integer vid = new Integer(0);
                 vid = vendorAcountViewMapper.getId(vendorAcountView.getPi_vendcode(), Long.valueOf(vendorAcountView.getCompanyId()));
-                Integer ym = Integer.valueOf(req.getYm());
-                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, ym, Long.valueOf(vendorAcountView.getCompanyId()));
+                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, cons, Long.valueOf(vendorAcountView.getCompanyId()));
                 if (vendOrCustAdd != null) {
-                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
                     //封装成list
                     Map<String, Double> map1 = new HashMap<>();
                     map1.put("beginamount", vendOrCustAdd.getBeginamount());
@@ -154,12 +153,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Integer vid = new Integer(0);
 
                 vid = customerCheckViewMapper.getId(customerCheckView.getPi_custcode(), Long.valueOf(customerCheckView.getCompanyId()));
-                Integer ym = Integer.valueOf(req.getYm());
-                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, ym, Long.valueOf(customerCheckView.getCompanyId()));
+                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, cons, Long.valueOf(customerCheckView.getCompanyId()));
                 if (vendOrCustAdd != null) {
-                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
                     //封装成list
                     Map<String, Double> map1 = new HashMap<>();
                     map1.put("beginamount", vendOrCustAdd.getBeginamount());
@@ -200,4 +195,10 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         }
         return map;
     }
+
+    public String getDate(String cons){
+        String date = cons.substring(8, 64);
+        System.out.println("date:" + date);
+        return date;
+    }
 }

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

@@ -52,13 +52,12 @@
         <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
     </resultMap>
     <select id="selectCustAdd" resultMap="BaseAddMap">
-    select distinct a.sl_orderamount as beginamount, b.sl_orderamount as nowamount, c.sl_orderamount as nowpay FROM
-(select sl_orderamount,sl_custid,sl_ym, companyid from subledger where sl_kind = '期初余额') a
-left join (select sum(sl_orderamount) sl_orderamount,sl_custid,sl_ym from subledger where sl_kind = '出货单' or sl_kind = '销售退货单'
-group by sl_custid,sl_ym) b on a.sl_custid=b.sl_custid
-left join (select sum(sl_orderamount) sl_orderamount,sl_custid,sl_ym from subledger where sl_kind = '收款单' or sl_kind = '其他收入单'
-group by sl_custid,sl_ym) c on a.sl_custid=c.sl_custid
- where a.sl_custid=#{sl_custid,jdbcType=INTEGER} and a.sl_ym=#{sl_ym, jdbcType=INTEGER} and a.companyid = #{companyId}
+    select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM
+    (select sl_orderamount,sl_custid,sl_date, companyid from subledger where sl_kind = '期初余额') a
+    left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_custid,sl_date from subledger where sl_kind !='期初余额'
+    group by sl_custid,sl_date) b
+    on a.sl_custid=b.sl_custid
+    where a.sl_custid=#{sl_custid} and a.sl_date ${cons} and a.companyid = #{companyId} limit 1
   </select>
 
     <select id="getId" resultType="java.lang.Integer">

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

@@ -55,13 +55,12 @@
     <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
   </resultMap>
   <select id="selectVendAdd" resultMap="BaseAddMap">
-    select distinct a.sl_orderamount as beginamount, b.sl_orderamount as nowamount, c.sl_orderamount as nowpay FROM
-(select sl_orderamount,sl_vendid,sl_ym, companyid from subledger where sl_kind = '期初余额') a
-left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '采购验收单' or sl_kind = '采购验退单'
-group by sl_vendid,sl_ym) b on a.sl_vendid=b.sl_vendid
-left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '付款单' or sl_kind = '其他支出单'
-group by sl_vendid,sl_ym) c on a.sl_vendid=c.sl_vendid
- where a.sl_vendid=#{sl_vendid,jdbcType=INTEGER} and a.sl_ym=#{sl_ym, jdbcType=INTEGER} and a.companyid = #{companyId}
+    select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM
+    (select sl_orderamount,sl_vendid,sl_date, companyid from subledger where sl_kind = '期初余额') a
+    left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_vendid,sl_date from subledger where sl_kind !='期初余额'
+    group by sl_vendid,sl_date) b
+    on a.sl_vendid=b.sl_vendid
+    where a.sl_vendid=#{sl_vendid} and a.sl_date ${cons} and a.companyid = #{companyId} limit 1
   </select>
 
   <select id="getId" resultType="java.lang.Integer">

+ 1 - 1
applications/sale/sale-server/src/main/resources/config/application-docker-test.yml

@@ -4,7 +4,7 @@ eureka:
     prefer-ip-address: false
   client:
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server-dev:8515/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server-test:8515/eureka/
 spring:
   rabbitmq:
     virtual-host: test

+ 11 - 1
framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java

@@ -543,9 +543,19 @@ public class DateUtils {
     //获取期间
     public static int getYm(Date date){
         String dates = date2String(date, "yyyyMM");
-//        dates = dates + "01";
         int d = Integer.parseInt(dates);
         return d;
     }
 
+    public static String plusDay(int num,String newDate) throws ParseException{
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        Date currdate = format.parse(newDate);
+        Calendar ca = Calendar.getInstance();
+        ca.setTime(currdate);
+        ca.add(Calendar.DATE, num);// num为增加的天数,可以改变的
+        Date next = ca.getTime();
+        String enddate = format.format(next);
+        return enddate;
+    }
+
 }

+ 35 - 50
frontend/saas-web/app.json

@@ -275,6 +275,39 @@
         "cacheParam": "_dc"
     },
 
+    "builds": {
+        "dev": {
+            "server": {
+                "accountCenter":"http://192.168.0.181:8000",
+                "accountEnterprise":"http://192.168.0.181:8000/#/enterprise",
+                "basePath": {
+                    "https": "https://saas-api-dev.usoftchina.com:5443",
+                    "http": "http://192.168.0.181:8560"
+                },
+                "urlPattern": "^\/api\/"
+            }
+        },
+        "test": {
+            "server": {
+                "accountCenter": "https://saas-test.usoftchina.com:5443",
+                "accountEnterprise": "https://saas-test.usoftchina.com:5443/#/enterprise",
+                "basePath": {
+                    "https": "https://saas-api-test.usoftchina.com:5443",
+                    "http": "http://192.168.0.181:8575"
+                },
+                "urlPattern": "^\/api\/"
+            }
+        },
+        "prod": {
+            "server": {
+                "accountCenter":"https://saas.usoftchina.com",
+                "accountEnterprise":"https://saas.usoftchina.com/#/enterprise",
+                "basePath": "https://saas-api.usoftchina.com",
+                "urlPattern": "^\/api\/"
+            }
+        }
+    },
+
     /**
      * Settings specific to production builds.
      */
@@ -293,12 +326,6 @@
         },
         "compressor": {
             "type": "yui"
-        },
-        "server": {
-            "accountCenter":"https://saas.usoftchina.com",
-            "accountEnterprise":"https://saas.usoftchina.com/#/enterprise",
-            "basePath": "https://saas-api.usoftchina.com",
-            "urlPattern": "^\/api\/"
         }
     },
 
@@ -306,39 +333,6 @@
      * Settings specific to testing builds.
      */
     "testing": {
-        "output": {
-            "appCache": {
-                "enable": true,
-                "path": "cache.appcache"
-            }
-        },
-        "loader": {
-            "cache": "${build.timestamp}"
-        },
-        "cache": {
-            "enable": true
-        },
-        "compressor": {
-            "type": "yui"
-        },
-        "server": {
-            /** 暂时更改
-            "accountCenter": "https://saas-test.usoftchina.com:5443",
-            "accountEnterprise": "https://saas-test.usoftchina.com:5443/#/enterprise",
-            "basePath": {
-                "https": "https://saas-api-test.usoftchina.com:5443",
-                "http": "http://192.168.0.181:8575"
-            },
-            "urlPattern": "^\/api\/"
-            **/
-            "accountCenter":"http://192.168.0.181:8000",
-            "accountEnterprise":"http://192.168.0.181:8000/#/enterprise",
-            "basePath": {
-                "https": "https://saas-api-dev.usoftchina.com:5443",
-                "http": "http://192.168.0.181:8560"
-            },
-            "urlPattern": "^\/api\/"
-        }
     },
 
     /**
@@ -347,15 +341,6 @@
     "development": {
         "watch": {
             "delay": 250
-        },
-        "server": {
-            "accountCenter":"http://192.168.0.181:8000",
-            "accountEnterprise":"http://192.168.0.181:8000/#/enterprise",
-            "basePath": {
-                "https": "https://saas-api-dev.usoftchina.com:5443",
-                "http": "http://192.168.0.181:8560"
-            },
-            "urlPattern": "^\/api\/"
         }
     },
 
@@ -410,7 +395,7 @@
      *          "css": "${app.output.resources}/${app.name}-all.css",
      *          "js": {
      *              "path": "app.js",
-     *              // This setting constrols the output language level.  Set to 'ES6' to 
+     *              // This setting constrols the output language level.  Set to 'ES6' to
      *              // disable the transpiler
      *              "version": "ES5"
      *          },
@@ -551,4 +536,4 @@
      * Normally you should never change this value.
      */
     "id": "a20e1670-7932-41f6-8e9c-55b77cba3f26"
-}
+}

+ 5 - 0
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -235,14 +235,19 @@ Ext.define('saas.view.core.base.ImportWindow', {
                                             saas.util.BaseUtil.showSuccessToast('上传成功');
                                             form.importId = id;
                                         }else{
+                                            field.setValue('');
                                             saas.util.BaseUtil.showErrorToast('上传失败:后台未返回信息');
                                         }
                                     }else{
+                                        field.setValue('');
+                                        field.setRawValue('');
+                                        field.value = '';
                                         saas.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
                                     }
                                 },
                                 failure: function (response, opts) {
                                     form.setLoading(false);
+                                    field.setValue('');
                                     var res = Ext.decode(response.responseText);
                                     saas.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
                                 }

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

@@ -6,7 +6,7 @@ Ext.define('saas.view.core.dbfind.types.BankInfoDbfindTrigger', {
     xtype: 'bandinfoDbfindTrigger',
 
     dataUrl: '/api/document/bankinformation/list',
-    addXtype: 'other-bankinformation',
+    addXtype: 'document-bankinformation-datalist',
     addTitle: '资金账户',
     dbtpls: [{
         field: 'bk_bankcode',

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

@@ -7,7 +7,7 @@ Ext.define('saas.view.core.dbfind.types.EmployeeDbfindTrigger', {
 
     //数据接口
     dataUrl:'/api/document/employee/list',
-    addXtype: 'other-employee',
+    addXtype: 'document-employee-datalist',
     addTitle: '人员资料',
     //联想设置
     dbtpls:[{

+ 2 - 64
frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
 
     dataUrl: '/api/document/warehouse/list',
     // dataUrl:'http://localhost:9480/warehouse/list',
-    addXtype: 'other-warehouse',
+    addXtype: 'document-warehouse-datalist',
     addTitle: '仓库资料',
     defaultCondition: "wh_statuscode='ENABLE'",
     dbtpls: [{
@@ -51,72 +51,10 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
         var tab = saas.util.BaseUtil.getCurrentTab();
         // this.isEdit = !!record;
         this.dialog = tab.add({
-            autoScroll:true,
-            xtype: 'document-kind-childwin',
+            xtype: 'document-warehouse-window',
             bind: {
                 title: '新增仓库资料'
             },
-            dataKind: 'warehouse',
-            belong: {
-                columns: [{
-                    text: '编号',
-                    dataIndex: 'wh_code',
-                    width: 150
-                },{
-                    text: '仓库名称',
-                    dataIndex: 'wh_description',
-                    width: 200
-                },{
-                    text: '类型',
-                    dataIndex: 'wh_type',
-                    width: 110
-                },{  
-                    text: '仓库状态码',
-                    dataIndex: 'wh_status',
-                    hidden:true,
-                },{
-                    text: '仓库状态',
-                    dataIndex: 'wh_statuscode',
-                    width:90,
-                    xtype: 'actioncolumn',
-                    align : 'center',
-                    items: [{
-                        iconCls:'',
-                        getClass: function(v, meta, rec) {
-                            if(rec.get('wh_statuscode')=='ENABLE'){
-                                return 'x-grid-checkcolumn-checked-btn';
-                            }else{
-                                return 'x-grid-checkcolumn-btn';
-                            }
-                        },
-                        handler: function(view, rowIndex, colIndex) {
-                            var rec = view.getStore().getAt(rowIndex);
-                            var type=rec.get('wh_statuscode')=='ENABLE'?true:false;
-                            //  禁用/启用
-                            var form = this.ownerCt.ownerCt.ownerCt;
-                            var grid = this.ownerCt.ownerCt;
-                            saas.util.BaseUtil.request({
-                                url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
-                                params: '',
-                                method: 'POST',
-                            })
-                            .then(function(localJson) {
-                                if(localJson.success){
-                                    saas.util.BaseUtil.showSuccessToast('操作成功');
-                                    grid.store.load();
-                                }
-                            })
-                            .catch(function(res) {
-                                console.error(res);
-                                saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
-                            });
-                        }
-                    }]
-                }],
-                keyField:'id',
-                reqUrl: '/api/document/warehouse/save',
-                delUrl: '/api/document/warehouse/delete'
-            },
             caller:'WareHouse',
             session: true
         });

+ 23 - 8
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -22,9 +22,14 @@ Ext.define('saas.view.core.report.ReportPanel', {
     searchItems: [], // 查询字段
     reportTitle: '报表',
     autoLoad:true,
+    printAble: true,
+    exportAble: true,
+    queryMode: 'DETAIL',
 
     initComponent: function() {
         var me = this;
+        var printAble = me.printAble;
+        var exportAble = me.exportAble;
         var store = me.initStore();
         columnWidth: 0.25,
         Ext.apply(me, {
@@ -49,6 +54,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     },{
                         xtype:'button',
                         text:'打印',
+                        hidden: !printAble,
                         style: {
                             float: 'right'
                         },
@@ -65,6 +71,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             float: 'right'
                         },
                         text: '导出',
+                        hidden: !exportAble,
                         menu: {
                             defaults: {
                                 handler: 'exportTo'
@@ -163,7 +170,6 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 }],
                 viewConfig: {
                     deferEmptyText: false,
-                    emptyText: '无数据',
                     listeners: {
                         itemcontextmenu: function(view, rec, node, index, e) {
                             e.stopEvent();
@@ -283,7 +289,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     var params = me.applyParams({
                         number: store.exportNumber?store.exportNumber:op._page,
                         size: store.exportPageSize?store.exportPageSize:store.pageSize,
-                        mode: 'DETAIL',
+                        mode: me.queryMode || 'DETAIL',
                         condition: JSON.stringify(condition),
                         calculateFields: JSON.stringify(summarys)
                     });
@@ -378,6 +384,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     initSearchItems: function() {
         var me = this,
+        queryItems = [],
         items = me.searchItems,
         viewModel = me.getViewModel();
 
@@ -392,6 +399,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 item.beforeLabelTextTpl = "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>";
             }
 
+            if(!ignore) {
+                queryItems.push(name);
+            }
+
             if(item.xtype == 'numberfield') {
                 Ext.applyIf(item, {
                     hideTrigger: true, // 隐藏trigger
@@ -427,7 +438,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             if(!th.fireEvent('beforequery', th)) {
                                 return;
                             }else {
-                                me.getController().onQuery()
+                                var p = this.up('core-report-reportpanel');
+                                p.getController().onQuery()
                             }
                         }
                     }
@@ -435,6 +447,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             });
         });
 
+        me.queryItems = queryItems;
+
         return items;
     },
 
@@ -444,17 +458,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
         formItems = form.items.items,
         viewModel = me.getViewModel(),
         viewModelData = viewModel.getData(),
-        bindItems = viewModelData['form'],
+        formData = viewModelData['form'] || {},
+        queryItems = me.queryItems,
         condition,
         conditions = [];
 
-        for(k in bindItems) {
+        for(var i = 0; i < queryItems.length; i++) {
+            var n = queryItems[i];
             var item = Ext.Array.findBy(formItems, function(i) {
-                return i.name == k;
+                return i.name == n;
             });
             var field = item.name,
             func = item.getCondition,
-            value = bindItems[k],
+            value = formData[n],
             condition;
 
             if(typeof func == 'function') {
@@ -463,7 +479,6 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     value: func(value)
                 }
             }else {
-                // var xtype = item.xtype || 'textfield',
                 type = item.fieldType || me.getDefaultFieldType(item),
                 operation = item.operation || me.getDefaultFieldOperation(item),
                 conditionValue = me.getConditionValue(item, value);

+ 42 - 0
frontend/saas-web/app/view/document/address/DataList.js

@@ -0,0 +1,42 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.address.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-address-datalist',
+    viewModel: 'document-address-datalist',
+    defaultType:'address',
+    windowType:'document-address-window',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        address:{
+            columns: [{
+                text: '地址名称',
+                dataIndex: 'ad_address',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/address/save',
+            delUrl: '/api/document/address/delete'
+        },
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'采购地址'});
+        }
+    }
+})
+
+

+ 48 - 0
frontend/saas-web/app/view/document/address/DataListModel.js

@@ -0,0 +1,48 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.address.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-address-datalist',
+    stores: {
+        address: {
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'ad_address',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/address/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        }  
+    }
+});

+ 32 - 0
frontend/saas-web/app/view/document/address/Window.js

@@ -0,0 +1,32 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.address.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-address-window',
+    dataKind:'address',//类型标识
+    belong:{
+        columns: [{
+            text: '地址名称',
+            dataIndex: 'ad_address',
+            flex: 1
+        }],
+        keyField:'id',
+        reqUrl: '/api/document/address/save',
+        delUrl: '/api/document/address/delete'
+    },
+    etc:{
+        address:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'ad_address',
+                allowBlank:false,
+                fieldLabel:'地址详情',
+                maxLength: 200
+            }]
+        }
+    }
+});

+ 82 - 0
frontend/saas-web/app/view/document/bankinformation/DataList.js

@@ -0,0 +1,82 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.bankinformation.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-bankinformation-datalist',
+    viewModel: 'document-bankinformation-datalist',
+    defaultType:'bankinformation',
+    windowType:'document-bankinformation-window',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        bankinformation:{
+            columns: [{
+                text: '账户编号',
+                dataIndex: 'bk_bankcode',
+                flex: 1
+            },{
+                text: '账户名称',
+                dataIndex: 'bk_bankname',
+                flex: 1
+            },{
+                text: '账户类别',
+                dataIndex: 'bk_type',
+                flex: 1,
+            },{
+                text: '期初金额',
+                dataIndex: 'bk_beginamount',
+                xtype: 'numbercolumn',
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                flex: 1
+            },{
+                text: '当前余额',
+                dataIndex: 'bk_thisamount',
+                xtype: 'numbercolumn',
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                flex: 1
+            },{
+                xtype:'datecolumn',
+                text: '建账日期',
+                format:'Y-m-d',
+                dataIndex: 'bk_date',
+                flex: 1
+            }, {
+                text: '备注',
+                dataIndex: 'bk_remark',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/bankinformation/save',
+            delUrl: '/api/document/bankinformation/delete'
+        }
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'资金账户'});
+        }
+    }
+})
+
+

+ 54 - 0
frontend/saas-web/app/view/document/bankinformation/DataListModel.js

@@ -0,0 +1,54 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.bankinformation.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-bankinformation-datalist',
+    stores: {
+        bankinformation:{
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'bk_bankname',  type: 'string'},
+                {name: 'bk_bankcode',  type: 'string'},
+                {name: 'bk_type',  type: 'string'},
+                {name: 'bk_beginamount',  type: 'float'},
+                {name: 'bk_thisamount',  type: 'float'},
+                {name: 'bk_date',  type: 'date'},
+                {name: 'updateTime', type: 'date'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/bankinformation/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        }  
+    }
+});

+ 128 - 0
frontend/saas-web/app/view/document/bankinformation/Window.js

@@ -0,0 +1,128 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.bankinformation.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-bankinformation-window',
+    dataKind:'bankinformation',//类型标识
+    belong:{
+        columns: [{
+            text: '账户编号',
+            dataIndex: 'bk_bankcode',
+            flex: 1
+        },{
+            text: '账户名称',
+            dataIndex: 'bk_bankname',
+            flex: 1
+        },{
+            text: '账户类别',
+            dataIndex: 'bk_type',
+            flex: 1,
+        },{
+            text: '期初金额',
+            dataIndex: 'bk_beginamount',
+            xtype: 'numbercolumn',
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
+            flex: 1
+        },{
+            text: '当前余额',
+            dataIndex: 'bk_thisamount',
+            xtype: 'numbercolumn',
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
+            flex: 1
+        },{
+            xtype:'datecolumn',
+            text: '建账日期',
+            format:'Y-m-d',
+            dataIndex: 'bk_date',
+            flex: 1
+        }, {
+            text: '备注',
+            dataIndex: 'bk_remark',
+            flex: 1
+        }],
+        keyField:'id',
+        reqUrl: '/api/document/bankinformation/save',
+        delUrl: '/api/document/bankinformation/delete'
+    },
+    etc:{
+        bankinformation:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'bk_bankcode',
+                allowBlank:false,
+                fieldLabel:'账户编号',
+                autoCode:true,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                name:'bk_bankname',
+                allowBlank:false,
+                fieldLabel:'账户名称',
+                maxLength: 20
+            },{
+                xtype:'numberfield',
+                name:'bk_beginamount',
+                allowBlank:false,
+                fieldLabel:'期初金额',
+                hideTrigger: true,
+                mouseWheelEnabled: false,
+                minValue: 0,
+                maxLength:15,
+                decimalPrecision:2,
+                enforceMaxLength:true
+            },
+            // {
+            //     xtype:'numberfield',
+            //     name:'bk_thisamount',
+            //     allowBlank:true,
+            //     fieldLabel:'当前余额',
+            //     hideTrigger: true,
+            //     mouseWheelEnabled: false,
+            //     beforeLabelTextTpl:'',
+            //     minValue: 0
+            // }
+            // ,
+            {
+                xtype:'combo',
+                name:'bk_type',
+                allowBlank:false,
+                editable:false,
+                fieldLabel:'账户类别',
+                store: [
+                    '现金',
+                    '银行'
+                ]
+            },{
+                xtype:'datefield',
+                name:'bk_date',
+                fieldLabel:'建账日期',
+                format:'Y-m-d',
+                listeners:{
+                    beforerender:function(d){
+                        d.setValue(new Date())
+                    }
+                }
+            }, {
+                xtype:'textfield',
+                name:'bk_remark',
+                allowBlank:true,
+                fieldLabel:'备注',
+                beforeLabelTextTpl:''
+            }]
+        }
+    }
+});

+ 94 - 0
frontend/saas-web/app/view/document/employee/DataList.js

@@ -0,0 +1,94 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.employee.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-employee-datalist',
+    viewModel: 'document-employee-datalist',
+    defaultType:'employee',
+    windowType:'document-employee-window',
+    _openUrl:'/api/document/employee/open',
+    _closeUrl:'/api/document/employee/close',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        employee:{
+            columns: [{
+                text: '人员编号',
+                dataIndex: 'em_code',
+                width: 150
+            },{
+                text: '人员名称',
+                dataIndex: 'em_name',
+                width: 110
+            },{
+                text: '联系电话',
+                dataIndex: 'em_mobile',
+                width: 110
+            },{  
+                text: '邮箱',
+                dataIndex: 'em_email',
+                width: 180
+            },{
+                text: '人员状态',
+                dataIndex: 'em_class',
+                width:90,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('em_class')=='正式'){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('em_class')=='正式'?true:false;
+                        //  禁用/启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                            params: '',
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showSuccessToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/employee/save',
+            delUrl: '/api/document/employee/delete'
+        }
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'人员资料'});
+        }
+    }
+})
+
+

+ 51 - 0
frontend/saas-web/app/view/document/employee/DataListModel.js

@@ -0,0 +1,51 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.employee.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-employee-datalist',
+    stores: {
+        employee:{
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'em_code',  type: 'string'},
+                {name: 'em_mobile',  type: 'string'},
+                {name: 'em_email',  type: 'string'},
+                {name: 'em_clasee',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/employee/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        }
+    }
+});

+ 123 - 0
frontend/saas-web/app/view/document/employee/Window.js

@@ -0,0 +1,123 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.employee.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-employee-window',
+    dataKind:'employee',//类型标识
+    belong:{
+        columns: [{
+            text: '人员编号',
+            dataIndex: 'em_code',
+            width: 150
+        },{
+            text: '人员名称',
+            dataIndex: 'em_name',
+            width: 110
+        },{
+            text: '联系电话',
+            dataIndex: 'em_mobile',
+            width: 110
+        },{  
+            text: '邮箱',
+            dataIndex: 'em_email',
+            width: 180
+        },{
+            text: '人员状态',
+            dataIndex: 'em_class',
+            width:90,
+            xtype: 'actioncolumn',
+            align : 'center',
+            items: [{
+                iconCls:'',
+                getClass: function(v, meta, rec) {
+                    if(rec.get('em_class')=='正式'){
+                        return 'x-grid-checkcolumn-checked-btn';
+                    }else{
+                        return 'x-grid-checkcolumn-btn';
+                    }
+                },
+                handler: function(view, rowIndex, colIndex) {
+                    var rec = view.getStore().getAt(rowIndex);
+                    var type=rec.get('em_class')=='正式'?true:false;
+                    //  禁用/启用
+                    var form = this.ownerCt.ownerCt.ownerCt;
+                    var grid = this.ownerCt.ownerCt;
+                    saas.util.BaseUtil.request({
+                        url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                        params: '',
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            saas.util.BaseUtil.showSuccessToast('操作成功');
+                            grid.store.load();
+                        }
+                    })
+                    .catch(function(res) {
+                        console.error(res);
+                        saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                    });
+                }
+            }]
+        }],
+        keyField:'id',
+        reqUrl: '/api/document/employee/save',
+        delUrl: '/api/document/employee/delete'
+    },
+    etc:{
+        employee:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员编号',
+                autoCode:true,
+                name: 'em_code',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员名称',
+                name: 'em_name',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '联系电话',
+                name: 'em_mobile',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '邮箱',
+                name: 'em_email', 
+                allowBlank:true,  
+                beforeLabelTextTpl: '',
+                maxLength: 20
+            },{
+                value:'正式',
+                xtype:'combo',
+                fieldLabel: '人员状态',
+                name: 'em_class',
+                allowBlank:false,
+                displayField : "display", 
+                editable:false,
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"正式", "value":'正式'},
+                        {"display":"离职", "value":'离职'}
+                    ]
+                }
+            },]
+        }
+    }
+});

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

@@ -1,7 +1,7 @@
 /**
  * Created by zhouy on 2018/10/18.
  */
-Ext.define('KitchenSink.view.binding.ChildForm', {
+Ext.define('saas.view.document.kind.ChildForm', {
     extend: 'Ext.window.Window',
     xtype: 'document-kind-childwin',
     cls:'x-window-dbfind',
@@ -129,98 +129,6 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 maxLength: 20
             }]
         },
-        bankinformation:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                name:'bk_bankcode',
-                allowBlank:false,
-                fieldLabel:'账户编号',
-                autoCode:true,
-                maxLength: 20
-            },{
-                xtype:'textfield',
-                name:'bk_bankname',
-                allowBlank:false,
-                fieldLabel:'账户名称',
-                maxLength: 20
-            },{
-                xtype:'numberfield',
-                name:'bk_beginamount',
-                allowBlank:false,
-                fieldLabel:'期初金额',
-                hideTrigger: true,
-                mouseWheelEnabled: false,
-                minValue: 0,
-                maxLength:15,
-                decimalPrecision:2,
-                enforceMaxLength:true
-            },
-            // {
-            //     xtype:'numberfield',
-            //     name:'bk_thisamount',
-            //     allowBlank:true,
-            //     fieldLabel:'当前余额',
-            //     hideTrigger: true,
-            //     mouseWheelEnabled: false,
-            //     beforeLabelTextTpl:'',
-            //     minValue: 0
-            // }
-            // ,
-            {
-                xtype:'combo',
-                name:'bk_type',
-                allowBlank:false,
-                editable:false,
-                fieldLabel:'账户类别',
-                store: [
-                    '现金',
-                    '银行'
-                ]
-            },{
-                xtype:'datefield',
-                name:'bk_date',
-                fieldLabel:'建账日期',
-                format:'Y-m-d',
-                listeners:{
-                    beforerender:function(d){
-                        d.setValue(new Date())
-                    }
-                }
-            }, {
-                xtype:'textfield',
-                name:'bk_remark',
-                allowBlank:true,
-                fieldLabel:'备注',
-                beforeLabelTextTpl:''
-            }]
-        },
-        productbrand:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                name:'pb_name',
-                allowBlank:false,
-                fieldLabel:'物料品牌',
-                maxLength: 20
-            }]
-        },  
-        productunit:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                name:'pu_name',
-                allowBlank:false,
-                fieldLabel:'计量单位',
-                maxLength: 20
-            }]
-        },
         inoutkind:{
             items:[{
                 xtype:'hidden',
@@ -255,18 +163,6 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 }
             }]
         },
-        address:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                name:'ad_address',
-                allowBlank:false,
-                fieldLabel:'地址详情',
-                maxLength: 200
-            }]
-        },
         accountinformation:{
             items:[{
                 xtype:'hidden',
@@ -431,110 +327,6 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 maxLength: 30,
             }]
         },
-        warehouse:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                fieldLabel: '仓库编号',
-                name: 'wh_code',
-                autoCode:true,
-                allowBlank:false,
-                maxLength: 20
-            },{
-                xtype:'textfield',
-                fieldLabel: '仓库名称',
-                name: 'wh_description',
-                allowBlank:false,
-                maxLength: 20
-            },{
-                xtype:'combo',
-                fieldLabel: '仓库类型',
-                name: 'wh_type',
-                allowBlank:false,
-                displayField : "display", 
-                editable:false,
-                hideTrigger : false, 
-                maxLength : 100.0, 
-                minValue : null, 
-                positiveNum : false, 
-                queryMode : "local", 
-                valueField : "value", 
-                store:{
-                    fields: ['display', 'value'],
-                    data : [
-                        {"display":"良品仓", "value":'良品仓'},
-                        {"display":"不良品仓", "value":'不良品仓'}
-                    ]
-                }
-            },{
-                readOnly:true,
-                xtype:'textfield',
-                fieldLabel: '仓库状态',
-                name: 'wh_status',   
-                value:'已启用',
-                maxLength: 20
-            },{
-                xtype:'hidden',
-                fieldLabel: '仓库状态码',
-                name: 'wh_statuscode',
-                value:'ENABLE'
-            }]
-        },
-        employee:{
-            items:[{
-                xtype:'hidden',
-                name:'id'
-            },{
-                xtype:'textfield',
-                fieldLabel: '人员编号',
-                autoCode:true,
-                name: 'em_code',
-                allowBlank:false,
-                maxLength: 20
-            },{
-                xtype:'textfield',
-                fieldLabel: '人员名称',
-                name: 'em_name',
-                allowBlank:false,
-                maxLength: 20
-            },{
-                xtype:'textfield',
-                fieldLabel: '联系电话',
-                name: 'em_mobile',
-                allowBlank:false,
-                maxLength: 20
-            },{
-                xtype:'textfield',
-                fieldLabel: '邮箱',
-                name: 'em_email', 
-                allowBlank:true,  
-                beforeLabelTextTpl: '',
-                maxLength: 20
-            },{
-                value:'正式',
-                xtype:'combo',
-                fieldLabel: '人员状态',
-                name: 'em_class',
-                allowBlank:false,
-                displayField : "display", 
-                editable:false,
-                hideTrigger : false, 
-                maxLength : 100.0, 
-                minValue : null, 
-                positiveNum : false, 
-                queryMode : "local", 
-                valueField : "value", 
-                store:{
-                    fields: ['display', 'value'],
-                    data : [
-                        {"display":"正式", "value":'正式'},
-                        {"display":"离职", "value":'离职'}
-                    ]
-                }
-            },]
-        },
         maxnumbers:{
             items:[{
                 xtype:'hidden',

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

@@ -106,76 +106,6 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl:'/api/document/producttype/save',
             delUrl:'/api/document/producttype/delete'
         }, 
-        productbrand:{
-            columns: [{
-                text: '物料品牌',
-                dataIndex: 'pb_name',
-                flex: 1
-            }],
-            keyField:'id',
-            reqUrl:'/api/document/productbrand/save',
-            delUrl:'/api/document/productbrand/delete'
-        },
-        productunit:{
-            columns: [{
-                text: '计量单位',
-                dataIndex: 'pu_name',
-                flex: 1
-            }],
-            keyField:'id',
-            reqUrl:'/api/document/productunit/save',
-            delUrl:'/api/document/productunit/delete'
-        },
-        bankinformation:{
-            columns: [{
-                text: '账户编号',
-                dataIndex: 'bk_bankcode',
-                flex: 1
-            },{
-                text: '账户名称',
-                dataIndex: 'bk_bankname',
-                flex: 1
-            },{
-                text: '账户类别',
-                dataIndex: 'bk_type',
-                flex: 1,
-            },{
-                text: '期初金额',
-                dataIndex: 'bk_beginamount',
-                xtype: 'numbercolumn',
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join();
-                    return Ext.util.Format.number(v, format);
-                },
-                flex: 1
-            },{
-                text: '当前余额',
-                dataIndex: 'bk_thisamount',
-                xtype: 'numbercolumn',
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join();
-                    return Ext.util.Format.number(v, format);
-                },
-                flex: 1
-            },{
-                xtype:'datecolumn',
-                text: '建账日期',
-                format:'Y-m-d',
-                dataIndex: 'bk_date',
-                flex: 1
-            }, {
-                text: '备注',
-                dataIndex: 'bk_remark',
-                flex: 1
-            }],
-            keyField:'id',
-            reqUrl: '/api/document/bankinformation/save',
-            delUrl: '/api/document/bankinformation/delete'
-        },
         inoutkind:{
             columns: [{
                 text: '收支名称',
@@ -190,16 +120,6 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl: '/api/document/fundinouttype/save',
             delUrl: '/api/document/fundinouttype/delete'
         },
-        address:{
-            columns: [{
-                text: '地址名称',
-                dataIndex: 'ad_address',
-                flex: 1
-            }],
-            keyField:'id',
-            reqUrl: '/api/document/address/save',
-            delUrl: '/api/document/address/delete'
-        },
         maxnumbers:{
             columns: [{
                 text : "单据名称", 
@@ -270,126 +190,6 @@ Ext.define('saas.view.document.kind.Kind', {
                 dataIndex: 'email',
             }],
             reqUrl: '/api/account/account/register/add',
-        },
-        employee:{
-            columns: [{
-                text: '人员编号',
-                dataIndex: 'em_code',
-                width: 150
-            },{
-                text: '人员名称',
-                dataIndex: 'em_name',
-                width: 110
-            },{
-                text: '联系电话',
-                dataIndex: 'em_mobile',
-                width: 110
-            },{  
-                text: '邮箱',
-                dataIndex: 'em_email',
-                width: 180
-            },{
-                text: '人员状态',
-                dataIndex: 'em_class',
-                width:90,
-                xtype: 'actioncolumn',
-                align : 'center',
-                items: [{
-                    iconCls:'',
-                    getClass: function(v, meta, rec) {
-                        if(rec.get('em_class')=='正式'){
-                            return 'x-grid-checkcolumn-checked-btn';
-                        }else{
-                            return 'x-grid-checkcolumn-btn';
-                        }
-                    },
-                    handler: function(view, rowIndex, colIndex) {
-                        var rec = view.getStore().getAt(rowIndex);
-                        var type=rec.get('em_class')=='正式'?true:false;
-                        //  禁用/启用
-                        var form = this.ownerCt.ownerCt.ownerCt;
-                        var grid = this.ownerCt.ownerCt;
-                        saas.util.BaseUtil.request({
-                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
-                            params: '',
-                            method: 'POST',
-                        })
-                        .then(function(localJson) {
-                            if(localJson.success){
-                                saas.util.BaseUtil.showSuccessToast('操作成功');
-                                grid.store.load();
-                            }
-                        })
-                        .catch(function(res) {
-                            console.error(res);
-                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
-                        });
-                    }
-                }]
-            }],
-            keyField:'id',
-            reqUrl: '/api/document/employee/save',
-            delUrl: '/api/document/employee/delete'
-        },
-        warehouse:{
-            columns: [{
-                text: '编号',
-                dataIndex: 'wh_code',
-                width: 150
-            },{
-                text: '仓库名称',
-                dataIndex: 'wh_description',
-                width: 200
-            },{
-                text: '类型',
-                dataIndex: 'wh_type',
-                width: 110
-            },{  
-                text: '仓库状态码',
-                dataIndex: 'wh_status',
-                hidden:true,
-            },{
-                text: '仓库状态',
-                dataIndex: 'wh_statuscode',
-                width:90,
-                xtype: 'actioncolumn',
-                align : 'center',
-                items: [{
-                    iconCls:'',
-                    getClass: function(v, meta, rec) {
-                        if(rec.get('wh_statuscode')=='ENABLE'){
-                            return 'x-grid-checkcolumn-checked-btn';
-                        }else{
-                            return 'x-grid-checkcolumn-btn';
-                        }
-                    },
-                    handler: function(view, rowIndex, colIndex) {
-                        var rec = view.getStore().getAt(rowIndex);
-                        var type=rec.get('wh_statuscode')=='ENABLE'?true:false;
-                        //  禁用/启用
-                        var form = this.ownerCt.ownerCt.ownerCt;
-                        var grid = this.ownerCt.ownerCt;
-                        saas.util.BaseUtil.request({
-                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
-                            params: '',
-                            method: 'POST',
-                        })
-                        .then(function(localJson) {
-                            if(localJson.success){
-                                saas.util.BaseUtil.showSuccessToast('操作成功');
-                                grid.store.load();
-                            }
-                        })
-                        .catch(function(res) {
-                            console.error(res);
-                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
-                        });
-                    }
-                }]
-            }],
-            keyField:'id',
-            reqUrl: '/api/document/warehouse/save',
-            delUrl: '/api/document/warehouse/delete'
         }
     },
     refresh:function(){

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

@@ -101,7 +101,7 @@ Ext.define('saas.view.document.kind.KindController', {
         this.isEdit = !!record;
         this.dialog = view.add({
             autoScroll:true,
-            xtype: 'document-kind-childwin',
+            xtype: view.windowType?view.windowType:'document-kind-childwin',
             bind: {
                 title: record ? '修改{title}' : '新增{title}'
             },

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

@@ -125,90 +125,6 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
-        productbrand:{
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'pb_name',  type: 'string'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/productbrand/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
-        },
-        bankinformation:{
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'bk_bankname',  type: 'string'},
-                {name: 'bk_bankcode',  type: 'string'},
-                {name: 'bk_type',  type: 'string'},
-                {name: 'bk_beginamount',  type: 'float'},
-                {name: 'bk_thisamount',  type: 'float'},
-                {name: 'bk_date',  type: 'date'},
-                {name: 'updateTime', type: 'date'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/bankinformation/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
-        },
         inoutkind:{ 
             fields:[
                 {name: 'id', type: 'int'},
@@ -249,88 +165,6 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
-        warehouse: {
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'wh_code',  type: 'string'},
-                {name: 'wh_type',  type: 'string'},
-                {name: 'wh_description',  type: 'string'},
-                {name: 'wh_statuscode',  type: 'string'},
-                {name: 'wh_status',  type: 'string'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/warehouse/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
-        },
-        address: {
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'ad_address',  type: 'string'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/address/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
-        },  
         accountinformation: {    
             fields:[
                 {name: 'id', type: 'int'},
@@ -369,87 +203,6 @@ Ext.define('saas.view.document.kind.KindModel', {
                     });
                 }
             }
-        },
-        employee:{
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'em_code',  type: 'string'},
-                {name: 'em_mobile',  type: 'string'},
-                {name: 'em_email',  type: 'string'},
-                {name: 'em_clasee',  type: 'string'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/employee/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
-        },
-        productunit: {    
-            fields:[
-                {name: 'id', type: 'int'},
-                {name: 'pu_name',  type: 'string'}
-            ],
-            proxy: {
-                type: 'ajax',
-                url: '/api/document/productunit/list',
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data'
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
-                                saas.util.BaseUtil.showErrorToast('请求超时');
-                            }
-                        }else {
-                            console.error('exception: ', response.responseJson);
-                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
-                        }
-                    }
-                }
-            },
-            pageSize: null,
-            autoLoad: false,
-            listeners: {
-                beforeload: function (store, op) {
-                    Ext.apply(store.proxy.extraParams, {
-                        number: 1,
-                        size: 1000
-                    });
-                }
-            }
         }
     }
 });

+ 0 - 30
frontend/saas-web/app/view/document/other/Address.js

@@ -1,30 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.document.other.Address', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-address',
-    autoScroll: true,
-    layout:'fit',
-    defaultType:'address',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'采购地址'});
-        }
-    }
-})
-
-

+ 0 - 31
frontend/saas-web/app/view/document/other/BankInformation.js

@@ -1,31 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.document.other.BankInformation', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-bankinformation',
-    autoScroll: true,
-    layout:'fit',
-    caller:'BankInformation',
-    defaultType:'bankinformation',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'资金账户'});
-        }
-    }
-})
-
-

+ 0 - 28
frontend/saas-web/app/view/document/other/Employee.js

@@ -1,28 +0,0 @@
-Ext.define('saas.view.document.other.Employee', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-employee',
-    autoScroll: true,
-    layout:'fit',
-    caller:'Employee',
-    _openUrl:'/api/document/employee/open',
-    _closeUrl:'/api/document/employee/close',
-    defaultType:'employee',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'人员资料'});
-        }
-    }
-})

+ 0 - 30
frontend/saas-web/app/view/document/other/ProductBrand.js

@@ -1,30 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.document.other.ProductBrand', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-productbrand',
-    autoScroll: true,
-    layout:'fit',
-    defaultType:'productbrand',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'物料品牌'});
-        }
-    }
-})
-
-

+ 0 - 30
frontend/saas-web/app/view/document/other/ProductUnit.js

@@ -1,30 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.document.other.ProductUnit', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-productunit',
-    autoScroll: true,
-    layout:'fit',
-    defaultType:'productunit',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'物料单位'});
-        }
-    }
-})
-
-

+ 0 - 28
frontend/saas-web/app/view/document/other/Warehouse.js

@@ -1,28 +0,0 @@
-Ext.define('saas.view.document.other.Warehouse', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'other-warehouse',
-    autoScroll: true,
-    layout:'fit',
-    caller:'Warehouse',
-    _openUrl:'/api/document/warehouse/open',
-    _closeUrl:'/api/document/warehouse/close',
-    defaultType:'warehouse',
-    tbar: ['->',{
-        xtype:'button',
-        text:'新增',
-        listeners: {
-            click: 'onAdd'
-        }
-    },{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'仓库'});
-        }
-    }
-})

+ 4 - 8
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -85,15 +85,13 @@ Ext.define('saas.view.document.product.FormPanel', {
         name : "pr_brand", 
         fieldLabel : "品牌", 
         addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
+            this.dialog = form.add({
+                xtype: 'document-productbrand-window',
                 bind: {
                     title: '新增物料品牌'
                 },
                 dataKind:'productbrand',
-                belong:document.etc['productbrand'],
                 _parent:form,
                 _combo:this.ownerCmp,
                 record:null,
@@ -110,15 +108,13 @@ Ext.define('saas.view.document.product.FormPanel', {
         allowBlank : false, 
         editable:false,
         addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
+            this.dialog = form.add({
+                xtype: 'document-productunit-window',
                 bind: {
                     title: '新增物料单位'
                 },
                 dataKind:'productunit',
-                belong:document.etc['productunit'],
                 _parent:form,
                 _combo:this.ownerCmp,
                 record:null,

+ 42 - 0
frontend/saas-web/app/view/document/productbrand/DataList.js

@@ -0,0 +1,42 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productbrand.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-productbrand-datalist',
+    viewModel: 'document-productbrand-datalist',
+    defaultType:'productbrand',
+    windowType:'document-productbrand-window',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        productbrand:{
+            columns: [{
+                text: '物料品牌',
+                dataIndex: 'pb_name',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl:'/api/document/productbrand/save',
+            delUrl:'/api/document/productbrand/delete'
+        }
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'物料品牌'});
+        }
+    }
+})
+
+

+ 48 - 0
frontend/saas-web/app/view/document/productbrand/DataListModel.js

@@ -0,0 +1,48 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productbrand.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-productbrand-datalist',
+    stores: {
+        productbrand:{
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'pb_name',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/productbrand/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        },
+    }
+});

+ 32 - 0
frontend/saas-web/app/view/document/productbrand/Window.js

@@ -0,0 +1,32 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productbrand.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-productbrand-window',
+    dataKind:'productbrand',//类型标识
+    belong:{
+        columns: [{
+            text: '物料品牌',
+            dataIndex: 'pb_name',
+            flex: 1
+        }],
+        keyField:'id',
+        reqUrl:'/api/document/productbrand/save',
+        delUrl:'/api/document/productbrand/delete'
+    },
+    etc:{
+        productbrand:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'pb_name',
+                allowBlank:false,
+                fieldLabel:'物料品牌',
+                maxLength: 20
+            }]
+        }
+    }
+});

+ 42 - 0
frontend/saas-web/app/view/document/productunit/DataList.js

@@ -0,0 +1,42 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productunit.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-productunit-datalist',
+    viewModel: 'document-productunit-datalist',
+    defaultType:'productunit',
+    windowType:'document-productunit-window',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        productunit:{
+            columns: [{
+                text: '计量单位',
+                dataIndex: 'pu_name',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl:'/api/document/productunit/save',
+            delUrl:'/api/document/productunit/delete'
+        }
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'物料单位'});
+        }
+    }
+})
+
+

+ 48 - 0
frontend/saas-web/app/view/document/productunit/DataListModel.js

@@ -0,0 +1,48 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productunit.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-productunit-datalist',
+    stores: {
+        productunit: {    
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'pu_name',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/productunit/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        }
+    }
+});

+ 32 - 0
frontend/saas-web/app/view/document/productunit/Window.js

@@ -0,0 +1,32 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.productunit.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-productunit-window',
+    dataKind:'productunit',//类型标识
+    belong:{
+        columns: [{
+            text: '计量单位',
+            dataIndex: 'pu_name',
+            flex: 1
+        }],
+        keyField:'id',
+        reqUrl:'/api/document/productunit/save',
+        delUrl:'/api/document/productunit/delete'
+    },
+    etc:{
+        productunit:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'pu_name',
+                allowBlank:false,
+                fieldLabel:'计量单位',
+                maxLength: 20
+            }]
+        }
+    }
+});

+ 94 - 0
frontend/saas-web/app/view/document/warehouse/DataList.js

@@ -0,0 +1,94 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.warehouse.DataList', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'document-warehouse-datalist',
+    viewModel: 'document-warehouse-datalist',
+    defaultType:'warehouse',
+    windowType:'document-warehouse-window',
+    _openUrl:'/api/document/warehouse/open',
+    _closeUrl:'/api/document/warehouse/close',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    etc:{
+        warehouse:{
+            columns: [{
+                text: '编号',
+                dataIndex: 'wh_code',
+                width: 150
+            },{
+                text: '仓库名称',
+                dataIndex: 'wh_description',
+                width: 200
+            },{
+                text: '类型',
+                dataIndex: 'wh_type',
+                width: 110
+            },{  
+                text: '仓库状态码',
+                dataIndex: 'wh_status',
+                hidden:true,
+            },{
+                text: '仓库状态',
+                dataIndex: 'wh_statuscode',
+                width:90,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('wh_statuscode')=='ENABLE'){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('wh_statuscode')=='ENABLE'?true:false;
+                        //  禁用/启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                            params: '',
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showSuccessToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/warehouse/save',
+            delUrl: '/api/document/warehouse/delete'
+        }
+    },
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'仓库'});
+        }
+    }
+})
+
+

+ 52 - 0
frontend/saas-web/app/view/document/warehouse/DataListModel.js

@@ -0,0 +1,52 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.warehouse.DataListModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.document-warehouse-datalist',
+    stores: {
+        warehouse: {
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'wh_code',  type: 'string'},
+                {name: 'wh_type',  type: 'string'},
+                {name: 'wh_description',  type: 'string'},
+                {name: 'wh_statuscode',  type: 'string'},
+                {name: 'wh_status',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/warehouse/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        if(operation.success) {
+                            if(response.timedout) {
+                                saas.util.BaseUtil.showErrorToast('请求超时');
+                            }
+                        }else {
+                            console.error('exception: ', response.responseJson);
+                            saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                        }
+                    }
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        }  
+    }
+});

+ 121 - 0
frontend/saas-web/app/view/document/warehouse/Window.js

@@ -0,0 +1,121 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.warehouse.Window', {
+    extend: 'saas.view.document.kind.ChildForm',
+    xtype: 'document-warehouse-window',
+    dataKind:'warehouse',//类型标识
+    belong:{
+        columns: [{
+            text: '编号',
+            dataIndex: 'wh_code',
+            width: 150
+        },{
+            text: '仓库名称',
+            dataIndex: 'wh_description',
+            width: 200
+        },{
+            text: '类型',
+            dataIndex: 'wh_type',
+            width: 110
+        },{  
+            text: '仓库状态码',
+            dataIndex: 'wh_status',
+            hidden:true,
+        },{
+            text: '仓库状态',
+            dataIndex: 'wh_statuscode',
+            width:90,
+            xtype: 'actioncolumn',
+            align : 'center',
+            items: [{
+                iconCls:'',
+                getClass: function(v, meta, rec) {
+                    if(rec.get('wh_statuscode')=='ENABLE'){
+                        return 'x-grid-checkcolumn-checked-btn';
+                    }else{
+                        return 'x-grid-checkcolumn-btn';
+                    }
+                },
+                handler: function(view, rowIndex, colIndex) {
+                    var rec = view.getStore().getAt(rowIndex);
+                    var type=rec.get('wh_statuscode')=='ENABLE'?true:false;
+                    //  禁用/启用
+                    var form = this.ownerCt.ownerCt.ownerCt;
+                    var grid = this.ownerCt.ownerCt;
+                    saas.util.BaseUtil.request({
+                        url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                        params: '',
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            saas.util.BaseUtil.showSuccessToast('操作成功');
+                            grid.store.load();
+                        }
+                    })
+                    .catch(function(res) {
+                        console.error(res);
+                        saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                    });
+                }
+            }]
+        }],
+        keyField:'id',
+        reqUrl: '/api/document/warehouse/save',
+        delUrl: '/api/document/warehouse/delete'
+    },
+    etc:{
+        warehouse:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                fieldLabel: '仓库编号',
+                name: 'wh_code',
+                autoCode:true,
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '仓库名称',
+                name: 'wh_description',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'combo',
+                fieldLabel: '仓库类型',
+                name: 'wh_type',
+                allowBlank:false,
+                displayField : "display", 
+                editable:false,
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"良品仓", "value":'良品仓'},
+                        {"display":"不良品仓", "value":'不良品仓'}
+                    ]
+                }
+            },{
+                readOnly:true,
+                xtype:'textfield',
+                fieldLabel: '仓库状态',
+                name: 'wh_status',   
+                value:'已启用',
+                maxLength: 20
+            },{
+                xtype:'hidden',
+                fieldLabel: '仓库状态码',
+                name: 'wh_statuscode',
+                value:'ENABLE'
+            }]
+        }
+    }
+});

+ 0 - 1
frontend/saas-web/app/view/home/InfoCard.scss

@@ -21,7 +21,6 @@ $max-card-width: 235px;
                         padding: 16px;
                         height: 120px;
                         border-radius: 0.5rem;
-                        box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
                         position: relative;
                         display: block;
                         cursor: pointer;

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

@@ -69,15 +69,12 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         columnWidth : 0.5,
         hiddenBtn:false,//true 则会关闭新增按钮功能
         addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
+            this.dialog = form.add({
+                xtype: 'document-address-window',
                 bind: {
                     title: '新增交货地址'
                 },
-                dataKind:'address',
-                belong:document.etc['address'],
                 _parent:form,
                 _combo:this.ownerCmp,
                 record:null,

+ 17 - 1
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -66,7 +66,23 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         name : "sa_toplace", 
         xtype : "textfield", 
         fieldLabel : "交货地址", 
-        columnWidth : 0.5
+        allowBlank : false, 
+        columnWidth : 0.5,
+        hiddenBtn:false,//true 则会关闭新增按钮功能
+        addHandler:function(b){
+            var form = this.ownerCmp.ownerCt;
+            this.dialog = form.add({
+                xtype: 'document-address-window',
+                bind: {
+                    title: '新增交货地址'
+                },
+                _parent:form,
+                _combo:this.ownerCmp,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 8 - 6
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js

@@ -184,11 +184,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
                 dataIndex: 'pr_detail',
                 width: 200
             },{
-                text: '型号',
-                dataIndex: 'pr_orispeccode',
-                width: 150
-            },{
-                text: '规格',
+                text: '型号规格',
                 dataIndex: 'pr_spec',
                 width: 150
             },{
@@ -199,7 +195,13 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
                 text: '数量',
                 dataIndex: 'pd_outqty',
                 xtype:'numbercolumn',
-                width: 110
+                width: 110,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
             },{
                 text: '拨出仓',
                 dataIndex: 'pd_whname',

+ 6 - 0
frontend/saas-web/app/view/stock/make/QueryPanel.js

@@ -136,6 +136,12 @@ Ext.define('saas.view.stock.make.QueryPanel', {
             dataIndex: 'ma_qty',
             xtype: 'numbercolumn',
             width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
         },{
             text: '单位',
             dataIndex: 'ma_produnit',

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

@@ -188,7 +188,13 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
             text: '数量',
             dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
-            width: 10
+            width: 10,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
         },{
             text: '仓库',
             dataIndex: 'pd_whname',

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

@@ -188,7 +188,13 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
             text: '数量',
             dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
-            width: 10
+            width: 10,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            }
         },{
             text: '仓库',
             dataIndex: 'pd_whname',

+ 70 - 6
frontend/saas-web/app/view/stock/report/DataList.js

@@ -9,33 +9,50 @@ Ext.define('saas.view.stock.report.DataList', {
 
     groupField: null,
     listUrl: '/api/document/product/ReserveCost',
+    // listUrl: 'http://192.168.253.41:8560/api/document/product/ReserveCost',
     defaultCondition: null,
     reportTitle: '物料库存数量金额表',
-    QueryWidth:0.2,
+    QueryWidth:0.15,
+    printAble: false,
+    exportAble: true,
 
     searchItems: [{
         name: 'pr_code',
         xtype: 'textfield',
         emptyText : '物料编号',
-        columnWidth: 0.2
+        columnWidth: 0.15
     },{
         name: 'pr_detail',
         xtype: 'textfield',
         emptyText : '物料名称',
-        columnWidth: 0.2
+        columnWidth: 0.15
     },{
         name: 'wh_code',
         xtype: 'textfield',
         emptyText : '仓库编号',
-        columnWidth: 0.2
+        columnWidth: 0.15
     },{
         name: 'wh_description',
         xtype: 'textfield',
         emptyText : '仓库名称',
-        columnWidth: 0.2
+        columnWidth: 0.15
+    }, {
+        name: 'wh_description',
+        xtype: 'textfield',
+        emptyText : '仓库名称',
+        columnWidth: 0.15
+    }, {
+        name: 'toggle',
+        xtype: 'checkbox',
+        fieldLabel : '分仓库存',
+        columnWidth: 0.1,
+        ignore: true,
+        listeners: {
+            change: 'toggle_change'
+        }
     }],
 
-    reportColumns : [{
+    reportColumns2 : [{
         text : "物料编号", 
         width : 150, 
         dataIndex : "rc_prodCode", 
@@ -102,6 +119,53 @@ Ext.define('saas.view.stock.report.DataList', {
             return Ext.util.Format.number(v, format);
         },
     }],
+
+    reportColumns : [{
+        text : "物料编号", 
+        width : 150, 
+        dataIndex : "rc_prodCode", 
+        xtype : "", 
+    },{
+        text : "物料名称", 
+        width : 200.0, 
+        dataIndex : "rc_prodDetail", 
+    }, 
+    {
+        text : "物料规格", 
+        dataIndex : "rc_prodSpec", 
+        width : 150.0, 
+    }, 
+    {
+        text : "单位", 
+        dataIndex : "rc_prodUnit", 
+        width : 80.0, 
+    }, 
+    {
+        text : "数量",
+        xtype: 'numbercolumn',
+        dataIndex : "rc_number", 
+        width : 110.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, 
+    {
+        text : "金额", 
+        xtype: 'numbercolumn',
+        dataIndex : "rc_amount", 
+        width : 110.0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        flex: 1
+    }],
 })
 
 

+ 17 - 4
frontend/saas-web/app/view/stock/report/DataListController.js

@@ -2,9 +2,22 @@ Ext.define('saas.view.stock.report.DataListController', {
     extend: 'saas.view.core.report.ReportPanelController',
     alias: 'controller.stock-report-datalist',
 
-    init: function (form) {
-        var me = this;
-        this.control({
-        });
+    toggle_change: function(field, newValue, oldValue, eOpts) {
+        var me = this,
+        reportPanel = me.getView(),
+        grid = reportPanel.down('grid'),
+        store = grid.store;
+        
+        if(newValue) {
+            reportPanel.queryMode = 'DETAIL';
+            store.load(function() {
+                grid.reconfigure(store, reportPanel.reportColumns2);
+            });
+        }else {
+            reportPanel.queryMode = 'MAIN';
+            store.load(function() {
+                grid.reconfigure(store, reportPanel.reportColumns);
+            });
+        }
     }
 });

+ 1 - 0
frontend/saas-web/app/view/sys/power/TreePanel.js

@@ -4,6 +4,7 @@ Ext.define('saas.view.sys.power.TreePanel', {
 
     dataUrl:'/api/account/role/list',
     deleteUrl:'/api/account/role/delete/',
+    focusable:false,
 
     initComponent: function () {
         var me = this;

+ 6 - 2
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -19,8 +19,7 @@ Ext.define('Ext.ux.feature.MySummary', {
     summaryRowCls: Ext.baseCSSPrefix + 'grid-row-summary ' + Ext.baseCSSPrefix + 'grid-row-total',
     summaryRowSelector: '.' + Ext.baseCSSPrefix + 'grid-row-summary.' + Ext.baseCSSPrefix + 'grid-row-total',
 
-    // turn off feature events.
-    hasFeatureEvent: false,
+    showSummaryRow: true,
 
     init: function(grid) {
         var me = this,
@@ -71,6 +70,7 @@ Ext.define('Ext.ux.feature.MySummary', {
                         '</table>',
                     ],
                     data: summarys,
+                    height: 36,
                     scrollable: {
                         x: false,
                         y: false
@@ -114,6 +114,10 @@ Ext.define('Ext.ux.feature.MySummary', {
 
         grid.summarys = summarys;
 
+        if(summarys.length == 0) {
+            me.showSummaryRow = false;
+        }
+
         return summarys;
     },
 

+ 2 - 2
frontend/saas-web/overrides/form/field/TrimVtype.js

@@ -3,10 +3,10 @@ Ext.define('saas.override.form.field.TrimVtype', {
 
     // vtype validation function
     trim: function(value) {
-        return this.trimRe.test(value);
+        return !this.trimRe.test(value);
     },
     // RegExp for the value to be tested against within the validation function
-    trimRe: /^(?! ).*(?<! )$/i,
+    trimRe: /(^ .*)|(.* $)/,
     // vtype Text property: The error text to display when the validation function returns false
     trimText: '请不要在内容的开头和结尾添加空格'
 });

+ 3 - 3
frontend/saas-web/package.json

@@ -6,9 +6,9 @@
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "dev": "sencha app watch",
-    "build-dev": "sencha app build --development",
-    "build-test": "sencha app build --testing",
-    "build": "sencha app build --production"
+    "build-dev": "sencha app build --build dev --testing",
+    "build-test": "sencha app build --build test --production",
+    "build": "sencha app build --build prod --production"
   },
   "keywords": [
     "saas"

+ 11 - 16
frontend/saas-web/resources/json/navigation.json

@@ -204,7 +204,7 @@
         }, {
             "id":"other-warehouse",
             "text": "仓库资料",
-            "viewType": "other-warehouse",
+            "viewType": "document-warehouse-datalist",
             "leaf": true
         }, {
             "id":"document-bom-basepanel",
@@ -213,14 +213,14 @@
             "addType": "document-bom-formpanel",
             "leaf": true
         }, {
-            "id":"other-bankinformation",
+            "id":"document-bankinformation-datalist",
             "text": "资金账户",
-            "viewType": "other-bankinformation",
+            "viewType": "document-bankinformation-datalist",
             "leaf": true
         },{
-            "id":"other-employee",
+            "id":"document-employee-datalist",
             "text": "人员资料",
-            "viewType": "other-employee",
+            "viewType": "document-employee-datalist",
             "leaf": true
         }]
     }, {
@@ -234,7 +234,7 @@
         }, {
             "id":"other-address",
             "text": "采购交货地址",
-            "viewType": "other-address",
+            "viewType": "document-address-datalist",
             "leaf": true
         }, {
             "config":"customerkind",
@@ -243,9 +243,9 @@
             "viewType": "document-kind",
             "leaf": true
         }, {
-            "id":"other-productunit",
+            "id":"document-productunit-datalist",
             "text": "计量单位",
-            "viewType": "other-productunit",
+            "viewType": "document-productunit-datalist",
             "leaf": true
         }, {
             "config":"productkind",
@@ -254,9 +254,9 @@
             "viewType": "document-kind",
             "leaf": true
         }, {
-            "id":"other-productbrand",
+            "id":"document-productbrand-datalist",
             "text": "物料品牌",
-            "viewType": "other-productbrand",
+            "viewType": "document-productbrand-datalist",
             "leaf": true
         }, {
             "config":"inoutkind",
@@ -271,12 +271,7 @@
     "iconCls": "x-sa sa-setting",
     "items": [{
         "text": "系统设置",
-        "items": [{
-            "id":"sys-guide-formpanel",
-            "text": "新手导航",
-            "viewType": "sys-guide-formpanel",
-            "leaf": true
-        }, {  
+        "items": [{  
             "id":"sys-manager-formpanel",
             "text": "系统管理",
             "viewType": "sys-manager-formpanel",