Просмотр исходного кода

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

zhouy 7 лет назад
Родитель
Сommit
89bed299e4
100 измененных файлов с 2075 добавлено и 705 удалено
  1. 10 8
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  2. 36 27
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java
  3. 46 6
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  4. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  5. 9 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  6. 3 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java
  7. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustomerCheckViewMapper.java
  8. 17 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PayablesdetailMapper.java
  9. 16 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ReceivablesdetailMapper.java
  10. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendorAcountViewMapper.java
  11. 175 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Payablesdetail.java
  12. 175 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Receivablesdetail.java
  13. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java
  14. 123 55
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  15. 12 6
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  16. 1 1
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  17. 1 1
      applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml
  18. 68 0
      applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml
  19. 67 0
      applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml
  20. 1 1
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  21. 2 2
      applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml
  22. 7 4
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  23. 1 1
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  24. 1 1
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  25. 1 1
      frontend/saas-portal-web/src/components/conenter/home.vue
  26. 0 25
      frontend/saas-portal-web/src/pages/cell/cell.html
  27. 0 0
      frontend/saas-portal-web/src/pages/cell/cell.js
  28. 0 15
      frontend/saas-portal-web/src/pages/cell/cell.vue
  29. BIN
      frontend/saas-portal-web/static/img/assets/1@2x.png
  30. BIN
      frontend/saas-portal-web/static/img/assets/2@3x.png
  31. BIN
      frontend/saas-portal-web/static/img/assets/3@2x.png
  32. BIN
      frontend/saas-portal-web/static/img/gongneng/Group 32.png
  33. BIN
      frontend/saas-portal-web/static/img/logo_w.png
  34. BIN
      frontend/saas-portal-web/static/img/qr-tech.png
  35. 7 0
      frontend/saas-web/app/Application.scss
  36. 3 0
      frontend/saas-web/app/view/core/base/ImportWindow.js
  37. 4 3
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  38. 4 0
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  39. 1 0
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  40. 7 2
      frontend/saas-web/app/view/core/form/FormPanelController.js
  41. 0 1
      frontend/saas-web/app/view/core/form/MseeageLog.js
  42. 37 24
      frontend/saas-web/app/view/core/form/MultiCombo.js
  43. 2 0
      frontend/saas-web/app/view/core/form/field/ConDateField.js
  44. 1 1
      frontend/saas-web/app/view/core/form/field/ConMonthField.js
  45. 9 14
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  46. 1 1
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  47. 284 267
      frontend/saas-web/app/view/core/report/ReportPanel.js
  48. 1 0
      frontend/saas-web/app/view/document/bankinformation/Window.js
  49. 4 6
      frontend/saas-web/app/view/document/bom/BasePanel.js
  50. 0 6
      frontend/saas-web/app/view/document/bom/FormController.js
  51. 8 13
      frontend/saas-web/app/view/document/customer/BasePanel.js
  52. 1 0
      frontend/saas-web/app/view/document/employee/Window.js
  53. 7 3
      frontend/saas-web/app/view/document/kind/ChildForm.js
  54. 4 14
      frontend/saas-web/app/view/document/product/BasePanel.js
  55. 7 11
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  56. 1 0
      frontend/saas-web/app/view/document/warehouse/Window.js
  57. 5 3
      frontend/saas-web/app/view/home/Home.js
  58. 82 21
      frontend/saas-web/app/view/home/HomeModel.js
  59. 147 0
      frontend/saas-web/app/view/home/charts/KeyData.js
  60. 111 0
      frontend/saas-web/app/view/home/charts/KeyData.scss
  61. 1 1
      frontend/saas-web/app/view/home/charts/MonthPurchase.js
  62. 1 1
      frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js
  63. 1 1
      frontend/saas-web/app/view/home/infoCardList/SaleOut.js
  64. 1 1
      frontend/saas-web/app/view/main/Main.js
  65. 2 2
      frontend/saas-web/app/view/main/Main.scss
  66. 2 2
      frontend/saas-web/app/view/main/MainController.js
  67. 1 1
      frontend/saas-web/app/view/main/MainModel.js
  68. 1 0
      frontend/saas-web/app/view/main/Navigation.scss
  69. 124 0
      frontend/saas-web/app/view/money/report/OtherIODetail.js
  70. 5 0
      frontend/saas-web/app/view/money/report/OtherIODetailController.js
  71. 4 0
      frontend/saas-web/app/view/money/report/OtherIODetailModel.js
  72. 50 45
      frontend/saas-web/app/view/money/report/PayDetail.js
  73. 2 2
      frontend/saas-web/app/view/money/report/PayDetailController.js
  74. 70 0
      frontend/saas-web/app/view/money/report/ProfitDetail.js
  75. 4 0
      frontend/saas-web/app/view/money/report/ProfitDetailController.js
  76. 4 0
      frontend/saas-web/app/view/money/report/ProfitDetailModel.js
  77. 54 41
      frontend/saas-web/app/view/money/report/RecDetail.js
  78. 2 2
      frontend/saas-web/app/view/money/report/RecDetailController.js
  79. 16 1
      frontend/saas-web/app/view/money/report/TotalPayDetail.js
  80. 15 0
      frontend/saas-web/app/view/money/report/TotalRecDetail.js
  81. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  82. 3 2
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  83. 36 15
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  84. 20 0
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  85. 8 3
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  86. 3 1
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  87. 4 4
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  88. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  89. 35 2
      frontend/saas-web/app/view/stock/report/DataList.js
  90. 12 10
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  91. 1 1
      frontend/saas-web/app/view/sys/account/AddWindow.js
  92. 5 4
      frontend/saas-web/ext/packages/ux/src/feature/MySummary.js
  93. 2 2
      frontend/saas-web/ext/packages/ux/src/feature/MySummary.scss
  94. 1 1
      frontend/saas-web/index.html
  95. 60 0
      frontend/saas-web/overrides/ux/TabCloseMenu.js
  96. BIN
      frontend/saas-web/resources/images/home/balanceTotal.png
  97. BIN
      frontend/saas-web/resources/images/home/payTotal.png
  98. BIN
      frontend/saas-web/resources/images/home/receiveTotal.png
  99. BIN
      frontend/saas-web/resources/images/home/storageTotal.png
  100. 8 4
      frontend/saas-web/resources/json/navigation.json

+ 10 - 8
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -30,26 +30,28 @@ public class CommonController {
     }
 
     @PostMapping("/action/audit")
-    public DeferredResult commonAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
+    public void commonAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
                                       @RequestParam("statuscode") String statuscode, @RequestParam("auditdate") String auditdate, @RequestParam("auditman") String auditman) {
 
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> commonService.commonAudit(table, keyvalue, status, statuscode, auditdate, auditman))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        commonService.commonAudit(table, keyvalue, status, statuscode, auditdate, auditman);
     }
 
     @PostMapping("/action/resAudit")
-    public DeferredResult commonResAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
+    public void commonResAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
                                       @RequestParam("statuscode") String statuscode, @RequestParam("auditdate") String auditdate, @RequestParam("auditman") String auditman) {
 
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> commonService.commonResAudit(table, keyvalue, status, statuscode, auditdate, auditman))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        commonService.commonResAudit(table, keyvalue, status, statuscode, auditdate, auditman);
     }
 
-    @GetMapping("/timeout/test")
+    /*@GetMapping("/timeout/test")
     public void timeout(@RequestParam("time") Long time){
         try {
             System.out.println("进入时间:" + time);
@@ -58,5 +60,5 @@ public class CommonController {
         }catch (Exception e){
             e.printStackTrace();
         }
-    }
+    }*/
 }

+ 36 - 27
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java

@@ -38,75 +38,83 @@ public class MessageLogController {
     }
 
     @RequestMapping("/save")
-    public DeferredResult<String> save(@RequestBody DocBaseDTO baseDTO) {
+    public void save(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.save(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.save(baseDTO);
     }
 
     @RequestMapping("/update")
-    public DeferredResult<String> update(@RequestBody DocBaseDTO baseDTO) {
+    public void update(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.update(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.update(baseDTO);
     }
 
     @RequestMapping("/delete")
-    public DeferredResult<String> delete(@RequestBody DocBaseDTO baseDTO) {
+    public void delete(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.delete(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.delete(baseDTO);
     }
 
     @RequestMapping("/deleteDetail")
-    public DeferredResult<String> deleteDetail(@RequestBody DocBaseDTO baseDTO) {
+    public void deleteDetail(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.deleteDetail(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.deleteDetail(baseDTO);
     }
 
     @RequestMapping("/audit")
-    public DeferredResult<String> audit(@RequestBody DocBaseDTO baseDTO) {
+    public void audit(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.audit(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.audit(baseDTO);
     }
 
     @RequestMapping("/unAudit")
-    public DeferredResult<String> unAudit(@RequestBody DocBaseDTO baseDTO) {
+    public void unAudit(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.unAudit(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.unAudit(baseDTO);
     }
 
     @RequestMapping("/close")
-    public DeferredResult<String> close(@RequestBody DocBaseDTO baseDTO) {
+    public void close(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.close(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.close(baseDTO);
     }
 
     @RequestMapping("/open")
-    public DeferredResult<String> open(@RequestBody DocBaseDTO baseDTO) {
+    public void open(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.open(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.open(baseDTO);
     }
 
     /**
@@ -117,12 +125,13 @@ public class MessageLogController {
     * @Date: 2018/10/25
     */
     @RequestMapping("/customizeLog")
-    public DeferredResult<String> customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam Operation operation) {
+    public void customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam Operation operation) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         System.out.println(operation.getTitle() + "  : " + operation.getResult());
         CompletableFuture.supplyAsync(() -> messageLogService.customizeLog(baseDTO, operation))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.customizeLog(baseDTO, operation);
     }
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.commons.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
 import com.usoftchina.saas.commons.dto.ProductBaseDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.mapper.DataImportDetailMapper;
@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * @author: guq
@@ -74,6 +76,7 @@ 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);
@@ -112,19 +115,19 @@ public class ExcelServiceImpl implements ExcelService{
         //获取最大列数
         int colnum = row.getPhysicalNumberOfCells();
         String key = null;
+        Map<String,String> map = null;
         //添加keys
-        for (int j = 0;j < colnum; j++){
+        for (int j = 0; j < colnum; j++){
             key = (String) getCellFormatValue(row.getCell(j));
             keys.add(key);
         }
         //存储数据
         for (int i = 2; i < rownum; i++) {
-            Map<String,String> map = new LinkedHashMap<String,String>();
+            map = new LinkedHashMap<String,String>();
             row = sheet.getRow(i);
             if(row !=null){
                 for (int j = 0;j < colnum; j++){
                     cellData = (String) getCellFormatValue(row.getCell(j));
-                    //检测字段必填与否
                     map.put(keys.get(j), cellData);
                 }
             }else{
@@ -134,6 +137,7 @@ public class ExcelServiceImpl implements ExcelService{
         }
         dataImportMapper.insertSelective(di);
         Integer keyvalue = di.getDi_id();
+        List<String> validateCode = Lists.newArrayList();
         //数据转换成字段
         if (!CollectionUtils.isEmpty(datas)) {
             StringBuilder err = new StringBuilder();
@@ -169,6 +173,7 @@ public class ExcelServiceImpl implements ExcelService{
                                mainData = new JSONObject();
                                codeValue = value;
                                difference = true;
+                               validateCode.add(codeValue);
                            }
                            //检查是否是同一单
                            if (set.isCodefield() && data.get("*" + set.getDescription()).equals("")) {
@@ -191,6 +196,10 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
+                           //如果为数字类型且为空默认赋值0
+                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
+                                value = "0";
+                           }
                            //插入主表数据
                            if (null != mainData) {
                                mainData.put(set.getField(), value);
@@ -213,7 +222,8 @@ public class ExcelServiceImpl implements ExcelService{
                                value = data.get(set.getDescription());
                            }
                            if ("true".equals(set.getNecessary()) && value.equals("")) {
-                               err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
+                               detailData = null;
+                               //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                break;
                            }
                            //检测日期类型是否规范
@@ -224,16 +234,28 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
+                           //如果为数字类型且为空默认赋值0
+                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
+                               value = "0";
+                           }
                            //拼从表数据
                            detailData.put(set.getField(), value);
                        }
-                       if (detailData.size() > 0) {
+                       if (null != detailData && detailData.size() > 0) {
                            dd.setDd_codevalue(codeValue);
                            dd.setDd_detaildata(detailData.toJSONString());
                        }
                    }
                 }
-                dataImportDetailMapper.insertSelective(dd);
+                //排除编号未填写但是其他字段填写的情况
+                if (StringUtils.hasText(codeValue)) {
+                    dataImportDetailMapper.insertSelective(dd);
+                }
+            }
+            //重复编号检测
+            List<String> samecode = getDuplicateElements(validateCode);
+            if (null != samecode && samecode.size() > 0) {
+                err.append("下列编号重复: " + printList(samecode) + " 请确认无误后再上传!");
             }
             //必填项检查
             if (err.length() > 0) {
@@ -244,6 +266,24 @@ public class ExcelServiceImpl implements ExcelService{
         return keyvalue;
     }
 
+    private  <E> List<E> getDuplicateElements(List<E> list) {
+        return list.stream() // list 对应的 Stream
+                .collect(Collectors.toMap(e -> e, e -> 1, (a, b) -> a + b)) // 获得元素出现频率的 Map,键为元素,值为元素出现的次数
+                .entrySet().stream() // 所有 entry 对应的 Stream
+                .filter(entry -> entry.getValue() > 1) // 过滤出元素出现次数大于 1 的 entry
+                .map(entry -> entry.getKey()) // 获得 entry 的键(重复元素)对应的 Stream
+                .collect(Collectors.toList());  // 转化为 List
+    }
+
+    private String printList(List list) {
+        String result = null;
+        if (!StringUtils.isEmpty(list)) {
+            result = list.toString().substring(1, list.toString().length() - 1);
+        }
+        return result;
+    }
+
+
 
 
     private boolean validateDateFormat(String date) {

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

@@ -67,11 +67,11 @@
     <select id="getSaleData" parameterType="long" resultType="string">
       select concat('[',five,',',other,']') from ((
 
-    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),'}')) five from (
+    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),',"z":"',si_custshortname,'"}')) five from (
     select * from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5
     ) c)d,(
 
-    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
+    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),',"z":"其它"}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
     ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 

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

@@ -323,8 +323,15 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     public DocBaseDTO close(Long id) {
         DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
+            Product product = getMapper().selectByPrimaryKey(id);
+            if (product == null) {
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
+                throw new BizException(BizExceptionCode.BIZ_BANNED);
+            }
             String code = getMapper().getCodeById(id);
-            Product product = new Product();
+            product = new Product();
             product.setId(id);
             product.setPr_status(Status.BANNED.getDisplay());
             product.setPr_statuscode(Status.BANNED.name());
@@ -349,7 +356,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             if (product == null) {
                 throw new BizException(BizExceptionCode.NO_DATA);
             }
-            if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
+            if (!Status.BANNED.getDisplay().equals(product.getPr_status())){
                 throw new BizException(BizExceptionCode.BIZ_ENABLE);
             }else{
                 product.setId(id);

+ 3 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java

@@ -80,9 +80,9 @@ public class MoneyReportColltroller {
     }
 
     //其他收支明细表
-    @GetMapping("/othrinoutdetails")
-    public Result othrinoutdetails(PageRequest page, ListReqDTO req) {
-        Map<String, Object> listData = moneyReportService.othrinoutdetails(page, req);
+    @GetMapping("/otheriodetail")
+    public Result otheriodetail(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.otheriodetail(page, req);
         return Result.success(listData);
     }
 

+ 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_custid, @Param("cons") String cons, @Param("companyId") Long companyId);
+    List<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);
 }

+ 17 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PayablesdetailMapper.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Payablesdetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface PayablesdetailMapper {
+
+    List<Payablesdetail> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+
+    Long selectIdByName(@Param("name") String name, @Param("companyId") Long companyId);
+
+    void callvend(Map<String, String> map);
+}

+ 16 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ReceivablesdetailMapper.java

@@ -0,0 +1,16 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Receivablesdetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ReceivablesdetailMapper {
+    List<Receivablesdetail> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+
+    Long selectIdByName(@Param("name") String name, @Param("companyId") Long companyId);
+
+    void callcust(Map<String, String> map);
+}

+ 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("cons") String cons, @Param("companyId") Long companyId);
+    List<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);
 }

+ 175 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Payablesdetail.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Payablesdetail {
+    private Integer pd_id;
+
+    private Integer pd_detno;
+
+    private Integer pd_vendid;
+
+    private String pd_vendcode;
+
+    private String pd_vendname;
+
+    private Date pd_date;
+
+    private String pd_code;
+
+    private String pd_kind;
+
+    private Integer pd_buyerid;
+
+    private String pd_buyername;
+
+    private Double pd_addpay;
+
+    private Double pd_addpre;
+
+    private Double pd_remain;
+
+    private Integer companyid;
+
+    private Integer pd_status;
+
+    private Integer pd_query;
+
+    private Integer pd_ym;
+
+    public Integer getPd_ym() {
+        return pd_ym;
+    }
+
+    public void setPd_ym(Integer pd_ym) {
+        this.pd_ym = pd_ym;
+    }
+
+    public Integer getPd_id() {
+        return pd_id;
+    }
+
+    public void setPd_id(Integer pd_id) {
+        this.pd_id = pd_id;
+    }
+
+    public Integer getPd_detno() {
+        return pd_detno;
+    }
+
+    public void setPd_detno(Integer pd_detno) {
+        this.pd_detno = pd_detno;
+    }
+
+    public Integer getPd_vendid() {
+        return pd_vendid;
+    }
+
+    public void setPd_vendid(Integer pd_vendid) {
+        this.pd_vendid = pd_vendid;
+    }
+
+    public String getPd_vendcode() {
+        return pd_vendcode;
+    }
+
+    public void setPd_vendcode(String pd_vendcode) {
+        this.pd_vendcode = pd_vendcode == null ? null : pd_vendcode.trim();
+    }
+
+    public String getPd_vendname() {
+        return pd_vendname;
+    }
+
+    public void setPd_vendname(String pd_vendname) {
+        this.pd_vendname = pd_vendname == null ? null : pd_vendname.trim();
+    }
+
+    public Date getPd_date() {
+        return pd_date;
+    }
+
+    public void setPd_date(Date pd_date) {
+        this.pd_date = pd_date;
+    }
+
+    public String getPd_code() {
+        return pd_code;
+    }
+
+    public void setPd_code(String pd_code) {
+        this.pd_code = pd_code == null ? null : pd_code.trim();
+    }
+
+    public String getPd_kind() {
+        return pd_kind;
+    }
+
+    public void setPd_kind(String pd_kind) {
+        this.pd_kind = pd_kind == null ? null : pd_kind.trim();
+    }
+
+    public Integer getPd_buyerid() {
+        return pd_buyerid;
+    }
+
+    public void setPd_buyerid(Integer pd_buyerid) {
+        this.pd_buyerid = pd_buyerid;
+    }
+
+    public String getPd_buyername() {
+        return pd_buyername;
+    }
+
+    public void setPd_buyername(String pd_buyername) {
+        this.pd_buyername = pd_buyername == null ? null : pd_buyername.trim();
+    }
+
+    public Double getPd_addpay() {
+        return pd_addpay;
+    }
+
+    public void setPd_addpay(Double pd_addpay) {
+        this.pd_addpay = pd_addpay;
+    }
+
+    public Double getPd_addpre() {
+        return pd_addpre;
+    }
+
+    public void setPd_addpre(Double pd_addpre) {
+        this.pd_addpre = pd_addpre;
+    }
+
+    public Double getPd_remain() {
+        return pd_remain;
+    }
+
+    public void setPd_remain(Double pd_remain) {
+        this.pd_remain = pd_remain;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getPd_status() {
+        return pd_status;
+    }
+
+    public void setPd_status(Integer pd_status) {
+        this.pd_status = pd_status;
+    }
+
+    public Integer getPd_query() {
+        return pd_query;
+    }
+
+    public void setPd_query(Integer pd_query) {
+        this.pd_query = pd_query;
+    }
+}

+ 175 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Receivablesdetail.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Receivablesdetail {
+    private Integer rd_id;
+
+    private Integer rd_detno;
+
+    private Integer rd_custid;
+
+    private String rd_custcode;
+
+    private String rd_custname;
+
+    private Date rd_date;
+
+    private String rd_code;
+
+    private String rd_kind;
+
+    private Integer rd_sellerid;
+
+    private String rd_sellername;
+
+    private Double rd_addrec;
+
+    private Double rd_addpre;
+
+    private Double rd_remain;
+
+    private Integer companyid;
+
+    private Integer rd_status;
+
+    private Integer rd_query;
+
+    private Integer rd_ym;
+
+    public Integer getRd_ym() {
+        return rd_ym;
+    }
+
+    public void setRd_ym(Integer rd_ym) {
+        this.rd_ym = rd_ym;
+    }
+
+    public Integer getRd_id() {
+        return rd_id;
+    }
+
+    public void setRd_id(Integer rd_id) {
+        this.rd_id = rd_id;
+    }
+
+    public Integer getRd_detno() {
+        return rd_detno;
+    }
+
+    public void setRd_detno(Integer rd_detno) {
+        this.rd_detno = rd_detno;
+    }
+
+    public Integer getRd_custid() {
+        return rd_custid;
+    }
+
+    public void setRd_custid(Integer rd_custid) {
+        this.rd_custid = rd_custid;
+    }
+
+    public String getRd_custcode() {
+        return rd_custcode;
+    }
+
+    public void setRd_custcode(String rd_custcode) {
+        this.rd_custcode = rd_custcode == null ? null : rd_custcode.trim();
+    }
+
+    public String getRd_custname() {
+        return rd_custname;
+    }
+
+    public void setRd_custname(String rd_custname) {
+        this.rd_custname = rd_custname == null ? null : rd_custname.trim();
+    }
+
+    public Date getRd_date() {
+        return rd_date;
+    }
+
+    public void setRd_date(Date rd_date) {
+        this.rd_date = rd_date;
+    }
+
+    public String getRd_code() {
+        return rd_code;
+    }
+
+    public void setRd_code(String rd_code) {
+        this.rd_code = rd_code == null ? null : rd_code.trim();
+    }
+
+    public String getRd_kind() {
+        return rd_kind;
+    }
+
+    public void setRd_kind(String rd_kind) {
+        this.rd_kind = rd_kind == null ? null : rd_kind.trim();
+    }
+
+    public Integer getRd_sellerid() {
+        return rd_sellerid;
+    }
+
+    public void setRd_sellerid(Integer rd_sellerid) {
+        this.rd_sellerid = rd_sellerid;
+    }
+
+    public String getRd_sellername() {
+        return rd_sellername;
+    }
+
+    public void setRd_sellername(String rd_sellername) {
+        this.rd_sellername = rd_sellername == null ? null : rd_sellername.trim();
+    }
+
+    public Double getRd_addrec() {
+        return rd_addrec;
+    }
+
+    public void setRd_addrec(Double rd_addrec) {
+        this.rd_addrec = rd_addrec;
+    }
+
+    public Double getRd_addpre() {
+        return rd_addpre;
+    }
+
+    public void setRd_addpre(Double rd_addpre) {
+        this.rd_addpre = rd_addpre;
+    }
+
+    public Double getRd_remain() {
+        return rd_remain;
+    }
+
+    public void setRd_remain(Double rd_remain) {
+        this.rd_remain = rd_remain;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getRd_status() {
+        return rd_status;
+    }
+
+    public void setRd_status(Integer rd_status) {
+        this.rd_status = rd_status;
+    }
+
+    public Integer getRd_query() {
+        return rd_query;
+    }
+
+    public void setRd_query(Integer rd_query) {
+        this.rd_query = rd_query;
+    }
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java

@@ -19,6 +19,6 @@ public interface MoneyReportService {
     Map<String, Object> accountdetails(PageRequest page, ListReqDTO req);
     Map<String, Object> vendormonthdetails(PageRequest page, ListReqDTO req);
     Map<String, Object> custormonthdetails(PageRequest page, ListReqDTO req);
-    Map<String, Object> othrinoutdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> otheriodetail(PageRequest page, ListReqDTO req);
     Map<String, Object> profitdetails(PageRequest page, ListReqDTO req);
 }

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

@@ -28,9 +28,9 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     @Autowired
     private VendorAcountViewMapper vendorAcountViewMapper;
     @Autowired
-    private PaydetailViewMapper paydetailViewMapper;
+    private PayablesdetailMapper payablesdetailMapper;
     @Autowired
-    private RecdetailViewMapper recdetailViewMapper;
+    private ReceivablesdetailMapper receivablesdetailMapper;
     @Autowired
     private AcountbalanceViewMapper acountbalanceViewMapper;
     @Autowired
@@ -41,6 +41,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     private VendmonthMapper vendmonthMapper;
     @Autowired
     private CustmonthMapper custmonthMapper;
+    @Autowired
+    private BanksubledgerMapper banksubledgerMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -83,8 +85,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     }
 
     @Override
-    public Map<String, Object> othrinoutdetails(PageRequest page, ListReqDTO req) {
-        return getListDATA(page, req, "othrinoutdetails");
+    public Map<String, Object> otheriodetail(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "otheriodetail");
     }
 
     @Override
@@ -93,6 +95,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     }
 
     private Map<String, Object> getListDATA(@PageDefault(size = 10) PageRequest page, ListReqDTO req, String type) {
+
+        //调用存储过程
         if ("custormonthdetails".equals(type)){
             Map map1 = this.getYm(req.getCondition());
             Map<String, Integer> map = new HashMap();
@@ -107,6 +111,35 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
             map.put("v_companyid",  Math.toIntExact(BaseContextHolder.getCompanyId()));
             vendmonthMapper.callVend(map);
+        }else if ("payDetail".equals(type)){
+            Map<String, String> maps = new HashMap<>();
+            Map<String, String> map = this.getIdAndDate(req.getCondition());
+            Long custid = new Long(0);
+            if (map.get("name") == null) {
+                custid = new Long(0);
+            }else {
+                custid = payablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
+            }
+            maps.put("V_vendid", String.valueOf(custid));
+            maps.put("V_start", map.get("yearmonth"));
+            maps.put("V_end", map.get("yearmonthTo"));
+            maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
+            payablesdetailMapper.callvend(maps);
+
+        }else if("recDetail".equals(type)){
+            Map<String, String> maps = new HashMap<>();
+            Map<String, String> map = this.getIdAndDate(req.getCondition());
+            Long custid = new Long(0);
+            if (map.get("name") == null) {
+                custid = new Long(0);
+            }else {
+                custid = receivablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
+            }
+            maps.put("V_custid", String.valueOf(custid));
+            maps.put("V_start", map.get("yearmonth"));
+            maps.put("V_end", map.get("yearmonthTo"));
+            maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
+            receivablesdetailMapper.callcust(maps);
         }
 
       /*  //设置默认分页
@@ -148,35 +181,43 @@ public class MoneyReportServiceImpl implements MoneyReportService {
 
                 Integer vid = new Integer(0);
                 vid = vendorAcountViewMapper.getId(vendorAcountView.getPi_vendcode(), Long.valueOf(vendorAcountView.getCompanyId()));
-                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, cons, Long.valueOf(vendorAcountView.getCompanyId()));
-                if (vendOrCustAdd != null) {
-                    //封装成list
-                    Map<String, Double> map1 = new HashMap<>();
-                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                    list1.add(map1);
-
-                    Map<String, Double> map2 = new HashMap<>();
-                    map2.put("nowamount", vendOrCustAdd.getNowamount());
-                    list1.add(map2);
-
-                    Map<String, Double> map3 = new HashMap<>();
-                    map3.put("nowpay", vendOrCustAdd.getNowpay());
-                    list1.add(map3);
-
-                    Map<String, Double> map4 = new HashMap<>();
-                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                    list1.add(map4);
+                List<VendOrCustAdd> vendOrCustAdds = vendorAcountViewMapper.selectVendAdd(vid, cons, Long.valueOf(vendorAcountView.getCompanyId()));
+                //封装成list
+                Map<String, Double> map1 = new HashMap<>();
+                map1.put("beginamount", new Double(0));
+                Map<String, Double> map2 = new HashMap<>();
+                map2.put("nowamount", new Double(0));
+                Map<String, Double> map3 = new HashMap<>();
+                map3.put("nowpay", new Double(0));
+                Map<String, Double> map4 = new HashMap<>();
+                map4.put("nowbalance", new Double(0));
+                if (vendOrCustAdds != null) {
+                    Iterator vlist = vendOrCustAdds.iterator();
+                    while (vlist.hasNext()) {
+                        VendOrCustAdd vendOrCustAdd = (VendOrCustAdd) vlist.next();
+                        map1.put("beginamount", vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount());
+                        list1.add(map1);
+
+                        map2.put("nowamount", vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount() + map2.get("nowamount"));
+                        list1.add(map2);
+
+                        map3.put("nowpay", vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay() + map3.get("nowpay"));
+                        list1.add(map3);
+
+                        map4.put("nowbalance", map1.get("beginamount") +  map2.get("nowamount") - map3.get("nowpay"));
+                        list1.add(map4);
+                    }
                 }
             }
         } else if("payDetail".equals(type)){
-            list = paydetailViewMapper.selectByCondition(con, companyId);
+            list = payablesdetailMapper.selectByCondition(con, companyId);
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
-                res = paydetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+                res = payablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
         }else if("recDetail".equals(type)){
-            list = recdetailViewMapper.selectByCondition(con, companyId);
+            list = receivablesdetailMapper.selectByCondition(con, companyId);
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
-                res = recdetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+                res = receivablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
         }else if ("acountBalance".equals(type)){
             list = acountbalanceViewMapper.selectByCondition(con, companyId);
@@ -193,24 +234,32 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Integer vid = new Integer(0);
 
                 vid = customerCheckViewMapper.getId(customerCheckView.getPi_custcode(), Long.valueOf(customerCheckView.getCompanyId()));
-                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, cons, Long.valueOf(customerCheckView.getCompanyId()));
-                if (vendOrCustAdd != null) {
-                    //封装成list
-                    Map<String, Double> map1 = new HashMap<>();
-                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                    list1.add(map1);
-
-                    Map<String, Double> map2 = new HashMap<>();
-                    map2.put("nowamount", vendOrCustAdd.getNowamount());
-                    list1.add(map2);
-
-                    Map<String, Double> map3 = new HashMap<>();
-                    map3.put("nowpay", vendOrCustAdd.getNowpay());
-                    list1.add(map3);
-
-                    Map<String, Double> map4 = new HashMap<>();
-                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                    list1.add(map4);
+                List<VendOrCustAdd> vendOrCustAdds = customerCheckViewMapper.selectCustAdd(vid, cons, Long.valueOf(customerCheckView.getCompanyId()));
+                //封装成list
+                Map<String, Double> map1 = new HashMap<>();
+                map1.put("beginamount", new Double(0));
+                Map<String, Double> map2 = new HashMap<>();
+                map2.put("nowamount", new Double(0));
+                Map<String, Double> map3 = new HashMap<>();
+                map3.put("nowpay", new Double(0));
+                Map<String, Double> map4 = new HashMap<>();
+                map4.put("nowbalance", new Double(0));
+                if (vendOrCustAdds != null) {
+                    Iterator vlist = vendOrCustAdds.iterator();
+                    while (vlist.hasNext()) {
+                        VendOrCustAdd vendOrCustAdd = (VendOrCustAdd) vlist.next();
+                        map1.put("beginamount", vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount());
+                        list1.add(map1);
+
+                        map2.put("nowamount", vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount() + map2.get("nowamount"));
+                        list1.add(map2);
+
+                        map3.put("nowpay", vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay() + map3.get("nowpay"));
+                        list1.add(map3);
+
+                        map4.put("nowbalance", map1.get("beginamount") +  map2.get("nowamount") - map3.get("nowpay"));
+                        list1.add(map4);
+                    }
                 }
             }
         }else if ("accountdetails".equals(type)){
@@ -222,9 +271,13 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             list = vendmonthMapper.selectByCondition(con, companyId);
             res = null;
         }else if ("custormonthdetails".equals(type)){
-            System.out.println("companyid"+companyId);
             list = custmonthMapper.selectByCondition(con, companyId);
             res = null;
+        }else if ("otheriodetail".equals(type)){
+            list = banksubledgerMapper.selectByCondition(con, companyId);
+            if (!StringUtils.isEmpty(calculateFieldsSql)) {
+                res = banksubledgerMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+            }
         }
 
         try {
@@ -271,23 +324,38 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             StringBuffer finalCondition = new StringBuffer();
             for (int i = 0; i < jsonArray.size(); i++) {
                 JSONObject jsonObject = (JSONObject) jsonArray.get(i);
-//
-//                String yearmonth = "yearmonth";
-//                String yearmonthTo = "yearmonthTo";
-//                if (st.equals("vend")){
-//                    yearmonth = "vm_" + yearmonth;
-//                    yearmonthTo = "vm_" + yearmonthTo;
-//                }else if (st.equals("cust")){
-//                    yearmonth = "cm_" + yearmonth;
-//                    yearmonthTo = "cm_" + yearmonthTo;
-//                }
+                String type = (String) jsonObject.get("type");
+                if ("date".equals(type)) {
                     String value = (String) jsonObject.get("value");
                     String[] arr = value.split(",");
                     map.put("yearmonth", arr[0]);
                     map.put("yearmonthTo", arr[1]);
+                }
             }
         }
         System.out.println("map:" + map);
         return map;
     }
+
+    public Map<String, String> getIdAndDate(String cons){
+        JSONArray jsonArray = JSONArray.parseArray(cons);
+        Map<String, String> map = new HashMap<>();
+        if (null != jsonArray && jsonArray.size() > 0) {
+            StringBuffer finalCondition = new StringBuffer();
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+                String type = (String) jsonObject.get("type");
+                if ("string".equals(type)){
+                    String value = (String) jsonObject.get("value");
+                    map.put("name", value);
+                }else if ("date".equals(type)){
+                    String value = (String) jsonObject.get("value");
+                    String[] arr = value.split(",");
+                    map.put("yearmonth", arr[0]);
+                    map.put("yearmonthTo", arr[1]);
+                }
+            }
+        }
+        return map;
+    }
 }

+ 12 - 6
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -455,27 +455,33 @@
 
 
     <select id="selectByCondition" resultMap="BaseResultMap">
-        select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark
-        from banksubledger
+        select *
+        from
+        (select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark, companyid
+        from banksubledger where bl_kind in ('其他收入单', '其他支出单'))a
         <where>
             <if test="con != null">
-                ${con}
+            ${con}
             </if>
             <if test="companyId != null">
-                and  companyId = #{companyId} and bl_kind = '其他支出单' or bl_kind = '其他收入单'
+            and  companyId = #{companyId}
             </if>
         </where>
         order by bl_bankname asc, bl_date desc,bl_bankcode desc
     </select>
 
     <select id="selectCalculateFields" resultType="string">
-        select   ${fields}  from banksubledger
+--         select   ${fields}  from banksubledger
+        select ${fields}
+        from
+        (select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark, companyid
+        from banksubledger where bl_kind in ('其他收入单', '其他支出单'))a
         <where>
             <if test="con != null">
                 ${con}
             </if>
             <if test="companyId != null">
-                and  companyId = #{companyId} and bl_kind = '其他支出单' or bl_kind = '其他收入单'
+                and  companyId = #{companyId}
             </if>
         </where>
     </select>

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

@@ -25,7 +25,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyId = #{companyId}
+        and  companyId = #{companyId} and (cm_endamount +cm_nowamount+ cm_nowpreamount + cm_beginamount) != 0
       </if>
     </where>
     order by cm_id desc, cm_yearmonth desc

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

@@ -58,7 +58,7 @@
     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 ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_custid=#{sl_custid} and ${cons} and a.companyid = #{companyId}
   </select>
 
     <select id="getId" resultType="java.lang.Integer">

+ 68 - 0
applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml

@@ -0,0 +1,68 @@
+<?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.money.mapper.PayablesdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Payablesdetail" >
+    <id column="pd_id" property="pd_id" jdbcType="INTEGER" />
+    <result column="pd_detno" property="pd_detno" jdbcType="INTEGER" />
+    <result column="pd_vendid" property="pd_vendid" jdbcType="INTEGER" />
+    <result column="pd_vendcode" property="pd_vendcode" jdbcType="VARCHAR" />
+    <result column="pd_vendname" property="pd_vendname" jdbcType="VARCHAR" />
+    <result column="pd_date" property="pd_date" jdbcType="DATE" />
+    <result column="pd_code" property="pd_code" jdbcType="VARCHAR" />
+    <result column="pd_kind" property="pd_kind" jdbcType="VARCHAR" />
+    <result column="pd_buyerid" property="pd_buyerid" jdbcType="INTEGER" />
+    <result column="pd_buyername" property="pd_buyername" jdbcType="VARCHAR" />
+    <result column="pd_addpay" property="pd_addpay" jdbcType="DOUBLE" />
+    <result column="pd_addpre" property="pd_addpre" jdbcType="DOUBLE" />
+    <result column="pd_remain" property="pd_remain" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="pd_status" property="pd_status" jdbcType="INTEGER" />
+    <result column="pd_query" property="pd_query" jdbcType="INTEGER" />
+    <result column="pd_ym" property="pd_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    pd_id, pd_detno, pd_vendid, pd_vendcode, pd_vendname, pd_date, pd_code, pd_kind, 
+    pd_buyerid, pd_buyername, pd_addpay, pd_addpre, pd_remain, companyid, pd_status, 
+    pd_query,pd_ym
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from payablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId} and pd_query =1 and (pd_addpay + pd_addpre + pd_remain) != 0
+      </if>
+    </where>
+    order by pd_vendname asc, pd_detno asc, pd_date desc
+  </select>
+
+  <select id="selectCalculateFields" resultType="string">
+    select   ${fields}  from payablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+  </select>
+
+  <select id="selectIdByName" resultType="long">
+    select ve_id from vendor where ve_name=#{name} and companyId=#{companyId}
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="V_vendid" jdbcType="INTEGER" mode="IN" />
+    <parameter property="V_start" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="V_end" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callvend" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_PAYABLESDETAIL_QUERY(?, ?, ?, ?)
+    </select>
+
+</mapper>

+ 67 - 0
applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml

@@ -0,0 +1,67 @@
+<?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.money.mapper.ReceivablesdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Receivablesdetail" >
+    <id column="rd_id" property="rd_id" jdbcType="INTEGER" />
+    <result column="rd_detno" property="rd_detno" jdbcType="INTEGER" />
+    <result column="rd_custid" property="rd_custid" jdbcType="INTEGER" />
+    <result column="rd_custcode" property="rd_custcode" jdbcType="VARCHAR" />
+    <result column="rd_custname" property="rd_custname" jdbcType="VARCHAR" />
+    <result column="rd_date" property="rd_date" jdbcType="DATE" />
+    <result column="rd_code" property="rd_code" jdbcType="VARCHAR" />
+    <result column="rd_kind" property="rd_kind" jdbcType="VARCHAR" />
+    <result column="rd_sellerid" property="rd_sellerid" jdbcType="INTEGER" />
+    <result column="rd_sellername" property="rd_sellername" jdbcType="VARCHAR" />
+    <result column="rd_addrec" property="rd_addrec" jdbcType="DOUBLE" />
+    <result column="rd_addpre" property="rd_addpre" jdbcType="DOUBLE" />
+    <result column="rd_remain" property="rd_remain" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="rd_status" property="rd_status" jdbcType="INTEGER" />
+    <result column="rd_query" property="rd_query" jdbcType="INTEGER" />
+    <result column="rd_ym" property="rd_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    rd_id, rd_detno, rd_custid, rd_custcode, rd_custname, rd_date, rd_code, rd_kind, 
+    rd_sellerid, rd_sellername, rd_addrec, rd_addpre, rd_remain, companyid, rd_status, 
+    rd_query,rd_ym
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from receivablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId} and rd_query = 1 and (rd_addrec + rd_addpre + rd_remain) != 0
+      </if>
+    </where>
+    order by rd_custname asc, rd_detno asc, rd_date desc
+  </select>
+
+  <select id="selectCalculateFields" resultType="string">
+    select   ${fields}  from receivablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+  </select>
+
+  <select id="selectIdByName" resultType="long">
+    select cu_id from customer where cu_name=#{name} and companyId=#{companyId}
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="V_custid" jdbcType="INTEGER" mode="IN" />
+    <parameter property="V_start" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="V_end" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callcust" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_RECEIVABLESDETAIL_QUERY(?, ?, ?, ?)
+    </select>
+</mapper>

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

@@ -25,7 +25,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyid = #{companyId}
+        and  companyid = #{companyId} and (vm_endamount+ vm_nowamount+vm_nowpreamount+vm_beginamount) != 0
       </if>
     </where>
     order by vm_id desc, vm_yearmonth desc

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

@@ -52,7 +52,7 @@
   <resultMap id="BaseAddMap" type="com.usoftchina.saas.money.po.VendOrCustAdd" >
     <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
     <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
-    <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+    <result column="nowpay" property="nowpay" jdbcType="DOUBLE" />
     <result column="nowbalance" property="nowbalance" jdbcType="DOUBLE" />
   </resultMap>
   <select id="selectVendAdd" resultMap="BaseAddMap">
@@ -61,7 +61,7 @@
     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 ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_vendid=#{sl_vendid} and ${cons} and a.companyid = #{companyId}
   </select>
 
   <select id="getId" resultType="java.lang.Integer">

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

@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -218,8 +219,8 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping("/sso/callback/{clientId}")
-    public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
+    @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
+    public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
                             @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
@@ -231,7 +232,7 @@ public class AuthController {
                 } else {
                     logger.error(result.getMessage());
                     ServletUtils.writeJsonPMessage(response, callback, false);
-                    return;
+                    return "successCallback({success:'0'})";
                 }
             } else {
                 accountDTO = result.getData();
@@ -242,7 +243,7 @@ public class AuthController {
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
                         ServletUtils.writeJsonPMessage(response, callback, false);
-                        return;
+                        return "successCallback({success:'0'})";
                     }
                 }
             }
@@ -263,9 +264,11 @@ public class AuthController {
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
+                return "successCallback({success:'1'})";
             }
             ServletUtils.writeJsonPMessage(response, callback, true);
         }
+        return "successCallback({success:'0'})";
     }
 
     /**

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/addgongsi.vue

@@ -110,7 +110,7 @@ import { setTimeout } from 'timers';
             VDistpicker
         },
         mounted(){
-            this.$refs.name.value = this.mytoken.account.realname
+            this.$refs.name.value = this.mytoken.account.realname == this.mytoken.account.mobile ? '' : this.mytoken.account.realname
             this.$refs.email.value = this.mytoken.account.email
         },
         methods: {

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -130,7 +130,7 @@ import { setTimeout } from 'timers';
                 const frame = window.frames[window.frames.length - 1]
                 frame.postMessage('', '*')
                 Session.remove()
-                window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+                window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
                 // this.$router.puth({path:'/home'})
             },
             //修改密码

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -345,7 +345,7 @@
         const frame = window.frames[window.frames.length - 1]
         frame.postMessage('', '*')
         Session.remove()
-        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
         //this.$router.go(0);
       },
       // 关闭窗口

+ 0 - 25
frontend/saas-portal-web/src/pages/cell/cell.html

@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
-</head>
-<body>
-    <div id="app">hello</div>
-    <script>
-        // iframe接收消息
-        window.addEventListener('message', function(e) {
-            if (e.data == 'removeToken') {
-                if (e.source != window.parent) {
-                    return;
-                }
-                var storeKey = 'app-state-session';
-                localStorage.removeItem(storeKey);
-                window.parent.postMessage("success", "*");
-            }
-        });
-    </script>
-</body>
-</html>

+ 0 - 0
frontend/saas-portal-web/src/pages/cell/cell.js


+ 0 - 15
frontend/saas-portal-web/src/pages/cell/cell.vue

@@ -1,15 +0,0 @@
-<template>
-    <div>
-
-    </div>
-</template>
-
-<script>
-    export default {
-        
-    }
-</script>
-
-<style scoped>
-
-</style>

BIN
frontend/saas-portal-web/static/img/assets/1@2x.png


BIN
frontend/saas-portal-web/static/img/assets/2@3x.png


BIN
frontend/saas-portal-web/static/img/assets/3@2x.png


BIN
frontend/saas-portal-web/static/img/gongneng/Group 32.png


BIN
frontend/saas-portal-web/static/img/logo_w.png


BIN
frontend/saas-portal-web/static/img/qr-tech.png


+ 7 - 0
frontend/saas-web/app/Application.scss

@@ -484,4 +484,11 @@ div::-webkit-scrollbar-track {
 /** tab **/
 .x-tab-default.x-tab-active .x-tab-close-btn {
   color: #34BAF6;
+}
+
+/** tabclosemenu **/
+.x-menu.x-tab-close-menu {
+  & > div > div > div.x-box-inner.x-box-scroller-body-vertical.x-scroller > div > div > a > span {
+    margin-left: 28px;
+  }
 }

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

@@ -98,6 +98,9 @@ Ext.define('saas.view.core.base.ImportWindow', {
                         if(!res.success){
                             saas.util.BaseUtil.showErrorToast('导入数据失败:' + res.message);
                         }else{
+                            //刷新界面
+                            var g = form.ownerCt.down('grid');
+                            g.store.loadPage(g.store.currentPage);
                             form.close();
                         }
                     },

+ 4 - 3
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -28,20 +28,21 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         width:300
     }],
     dbColumns: [{
-        conditionCode: 'id',
         text: "客户ID",
         dataIndex: "id",
         hidden:true
     }, {
-        conditionCode: 'cu_code',
         text: "客户编号",
         dataIndex: "cu_code",
         width: 150
     }, {
-        conditionCode: 'cu_name',
         text: "客户名称",
         dataIndex: "cu_name",
         width: 200
+    }, {
+        text: "客户简称",
+        dataIndex: "cu_shortname",
+        width: 150
     }, {
         conditionCode: 'cu_type',
         text: "客户类型",

+ 4 - 0
frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js

@@ -41,6 +41,10 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         text: "供应商名称",
         dataIndex: "ve_name",
         width: 200
+    }, {
+        text: "供应商简称",
+        dataIndex: "ve_shortname",
+        width: 150
     }, {
         text: "供应商类型",
         dataIndex: "ve_type",

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

@@ -55,6 +55,7 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
             bind: {
                 title: '新增仓库资料'
             },
+            _parent:this,
             caller:'WareHouse',
             session: true
         });

+ 7 - 2
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -387,11 +387,16 @@ Ext.define('saas.view.core.form.FormPanelController', {
         mlCaller = form.caller,
         win = Ext.getCmp(form.xtype+mlKeyvalue);
         if (!win&&mlKeyvalue!=0) {
+            var panel = form.up('core-tab-panel'),panelEl;panelEl = panel.getEl()
+            var box = panelEl.getBox();
+            var height = box.height;
+            var width = box.width;
             var win = form.add(Ext.create('Ext.window.Window', {
                 modal: true,
                 id:me.xtype+mlKeyvalue,
-                height: '60%',
-                width: '80%',
+                cls:'x-window-dbfind',
+                height: height*0.8,
+                width: width*0.8,
                 title: '操作日志('+viewModel.get(form._codeField)+')',
                 scrollable: true,
                 constrain: true,

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

@@ -3,7 +3,6 @@ Ext.define('saas.view.core.form.MseeageLog', {
     xtype: 'core-form-mseeageLog',
 
     autoScroll: true,
-    frame:true,
     layout:'fit',
     dataUrl:'/api/commons/messagelog/list',
 

+ 37 - 24
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -16,21 +16,24 @@ Ext.define('saas.view.core.form.MultiCombo', {
         me.callParent(arguments);
     },
     listeners:{
-        afterrender:function(f){
-            this.mon(f.el,{
-                mouseover: this.onMouseOver,
-                mouseleave:this.onMouseLeave,
-                scope:this
-            });
-        }
+        focus: function() {
+            this.showMenu();
+        },
+        // afterrender:function(f){
+        //     this.mon(f.el,{
+        //         mouseover: this.onMouseOver,
+        //         mouseleave:this.onMouseLeave,
+        //         scope:this
+        //     });
+        // }
 
     },
-    onMouseOver:function(){
-       this.showMenu();
-    },
-    onMouseLeave:function(a,b,c){
-        this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
-    },
+    // onMouseOver:function(){
+    //    this.showMenu();
+    // },
+    // onMouseLeave:function(a,b,c){
+    //     this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
+    // },
     onTriggerClick:function(){
         this.showMenu();
     },
@@ -42,10 +45,10 @@ Ext.define('saas.view.core.form.MultiCombo', {
             me.menu = Ext.create('Ext.menu.Menu',{
                 hideOnParentHide: false,
                 items: me.getMenuItems(),
-                listeners:{
-                    mouseleave:me.onMouseLeave,
-                    scope:me
-                }
+                // listeners:{
+                //     mouseleave:me.onMouseLeave,
+                //     scope:me
+                // }
             });
         }
         return me.menu;
@@ -93,17 +96,27 @@ Ext.define('saas.view.core.form.MultiCombo', {
         var me = this, rawV = '',
         datas = me.datas,
         menu = me.menu;
-        if(!Ext.isArray(items)) {
-            items = [items]
+        if(Ext.isString(items)) {
+            items = items.split(',');
         }
         items.map(function(item, index) {
             if(Ext.isString(item)) {
-                var data = datas.find(function(d) {
-                    return d[0] == item;
+                // var data = datas.find(function(d) {
+                //     return d[0] == item;
+                // });
+                var data = Ext.Array.findBy(datas, function(d) {
+                    return d[0] == item || d[1] == item;
                 });
-                items[index] = {
-                    text: data[1],
-                    value: data[0]
+                if(data) {
+                    items[index] = {
+                        text: data[1],
+                        value: data[0]
+                    }
+                }else {
+                    items[index] = {
+                        text: item,
+                        value: item
+                    }
                 }
             }
         })

+ 2 - 0
frontend/saas-web/app/view/core/form/field/ConDateField.js

@@ -60,6 +60,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             formatText: '',
             allowBlank: allowBlank,
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '起始时间',
             //matchFieldWidth:true,
@@ -95,6 +96,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             format: 'Y-m-d',
             formatText: '',
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '结束时间',
             listeners: {

+ 1 - 1
frontend/saas-web/app/view/core/form/field/ConMonthField.js

@@ -63,7 +63,7 @@ Ext.define('saas.view.core.form.field.ConMonthField', {
         fromField = container.from,
         fromValue = fromField.value;
 
-        if(Number(value) <= Number(fromValue)) {
+        if(Number(value) < Number(fromValue)) {
             return false;
         }else {
             return true;

+ 9 - 14
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -217,25 +217,20 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         store.each(function(s) {
             var itemFields = s.fields,
             itemData = s.getData(),
+            detno = itemData[detnoColumn],
+            id = itemData.id,
             dirtyFields = [];
 
-            for(var x = 0; x < itemFields.length; x++) {
-                var field = itemFields[x],
-                name = field.name,
-                type = field.type;
-
-                if(type == 'int' && itemData[name] == 0) {
-                }else if(type == 'string' && itemData[name] == '') {
-                }else if(type == 'float' && itemData[name] == 0) {
-                }else if(type == 'date' && itemData[name] == null) {
-                }else {
-                    dirtyFields.push(name);
-                }
+            if(s.isDirty()) {
+                var modified = s.modified;
+                var dirtyFields = Ext.Object.getAllKeys(modified);
             }
 
-            // 如果有有效数据(非ID和序号列)才算dirty,否则直接commit
+            // 如果有有效数据才算dirty,否则直接commit
             if(dirtyFields.length == 2 && Ext.Array.contains(dirtyFields, 'id') && Ext.Array.contains(dirtyFields, detnoColumn)) {
-                s.commit()
+                s.commit();
+            }else if(!Ext.isNumber(id) && dirtyFields.length == 1 && dirtyFields[0] == detnoColumn) {
+                s.commit();
             }
         });
 

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

@@ -77,7 +77,7 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
     listeners: {
         boxReady:function(form){
             if(window.innerHeight - 110 >= 800){
-                form.setHeight(112);
+                form.setHeight(96);
             }
         },
         beforerender: function(form) {

+ 284 - 267
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -13,7 +13,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     layout: 'vbox',
     autoScroll: true,
-    bodyBorder:false,
+    bodyBorder: false,
     bodyPadding: 5,
 
     groupField: null, // 分组字段
@@ -21,162 +21,124 @@ Ext.define('saas.view.core.report.ReportPanel', {
     defaultCondition: null, // 默认查询条件
     searchItems: [], // 查询字段
     reportTitle: '报表',
-    autoLoad:true,
+    autoLoad: true,
     allowPaging: true,
     printAble: true,
     exportAble: true,
+    showMySummary: true,
     queryMode: 'DETAIL',
 
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         var printAble = me.printAble;
         var exportAble = me.exportAble;
         var store = me.initStore();
         columnWidth: 0.25,
-        Ext.apply(me, {
-            items: [{
-                xtype: 'form',
-                width: '100%',
-                layout: 'column',
-                defaults:{
-                    margin: '0 5 5 0',
-                    labelAlign: 'right',
-                    labelWidth: 90,
-                    columnWidth: 0.25,
-                },
-                items: me.initSearchItems().concat([{
-                    xtype: 'container',
-                    columnWidth: me.QueryWidth || 0.5,
-                    items: [{
-                        xtype: 'button',
-                        text: '查询',
-                        handler: 'onQuery',
-                        formBind:true
-                    },{
-                        xtype:'button',
-                        text:'打印',
-                        hidden: !printAble,
-                        style: {
-                            float: 'right'
-                        },
-                        handler: 'exportTo',
-                        cfg: {
-                            type: 'html',
-                            includeGroups: true,
-                            includeSummary: true,
-                            isPrint:true
-                        }
-                    },{
-                        xtype: 'button',
-                        style: {
-                            float: 'right'
-                        },
-                        text: '导出',
-                        hidden: !exportAble,
-                        menu: {
-                            defaults: {
-                                handler: 'exportTo'
+            Ext.apply(me, {
+                items: [{
+                    xtype: 'form',
+                    width: '100%',
+                    layout: 'column',
+                    defaults: {
+                        margin: '0 5 5 0',
+                        labelAlign: 'right',
+                        labelWidth: 90,
+                        columnWidth: 0.25,
+                    },
+                    items: me.initSearchItems().concat([{
+                        xtype: 'container',
+                        columnWidth: me.QueryWidth || 0.5,
+                        items: [{
+                            xtype: 'button',
+                            text: '查询',
+                            handler: 'onQuery',
+                            formBind: true
+                        }, {
+                            xtype: 'button',
+                            text: '打印',
+                            hidden: !printAble,
+                            style: {
+                                float: 'right'
                             },
-                            items: [{
-                                text: 'Excel xlsx',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx'
-                                }
-                            }, {
-                                text: 'Excel xlsx (包含分组合计)',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            }, {
-                            //     text: 'Excel xml',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml'
-                            //     }
-                            // }, {
-                            //     text: 'Excel xml (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            // }, {
-                                text: 'CSV',
-                                cfg: {
-                                    type: 'csv'
-                                }
-                            }, {
-                                text: 'CSV (包含分组合计)',
-                                cfg: {
-                                    type: 'csv',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            //     text: 'TSV',
-                            //     cfg: {
-                            //         type: 'tsv',
-                            //         ext: 'csv'
-                            //     }
-                            // }, {
-                            //     text: 'HTML',
-                            //     cfg: {
-                            //         type: 'html'
-                            //     }
-                            // }, {
-                            //     text: 'HTML (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'html',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            }]
-                        }
-                    }]
-                }])
-            }, {
-                xtype: 'grid',
-                width: '100%',
-                cls: 'x-report-grid',
-                flex: 1,
-                border: 0,
-                sortableColumns: false,
-                enableColumnHide: false,
-                rowLines: false,
-                plugins: [{
-                    ptype: 'gridexporter',
-                }, {
-                    ptype: 'menuclipboard'
-                }],
-                features: [{
-                    ftype: 'groupingsummary',
-                    hideGroupedHeader: false,
-                    enableGroupingMenu: false,
-                    collapsible: false
+                            handler: 'exportTo',
+                            cfg: {
+                                type: 'html',
+                                includeGroups: true,
+                                includeSummary: true,
+                                isPrint: true
+                            }
+                        }, {
+                            xtype: 'button',
+                            style: {
+                                float: 'right'
+                            },
+                            text: '导出',
+                            hidden: !exportAble,
+                            menu: {
+                                defaults: {
+                                    handler: 'exportTo'
+                                },
+                                items: [{
+                                    text: 'Excel xlsx',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx'
+                                    }
+                                }, {
+                                    text: 'Excel xlsx (包含分组合计)',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }, {
+                                    text: 'CSV',
+                                    cfg: {
+                                        type: 'csv'
+                                    }
+                                }, {
+                                    text: 'CSV (包含分组合计)',
+                                    cfg: {
+                                        type: 'csv',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }]
+                            }
+                        }]
+                    }])
                 }, {
-                    ftype: 'mysummary',
-                    dock: 'bottom'
-                }],
-                store: store,
-                columns: me.initColumns(),
-                dockedItems: [me.allowPaging ? {
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: store
-                } : null],
-            }]
-        });
+                    xtype: 'grid',
+                    width: '100%',
+                    cls: 'x-report-grid',
+                    flex: 1,
+                    border: 0,
+                    sortableColumns: false,
+                    enableColumnHide: false,
+                    rowLines: false,
+                    plugins: [{
+                        ptype: 'gridexporter',
+                    }, {
+                        ptype: 'menuclipboard'
+                    }],
+                    features: me.initFeatures(),
+                    store: store,
+                    columns: me.initColumns(),
+                    dockedItems: [me.allowPaging ? {
+                        xtype: 'pagingtoolbar',
+                        dock: 'bottom',
+                        displayInfo: true,
+                        store: store
+                    } : null],
+                }]
+            });
 
         me.callParent(arguments);
     },
 
     listeners: {
-        boxready: function(p) {
+        boxready: function (p) {
             var allowPaging = p.allowPaging;
             var grid = p.down('grid');
             var store = grid.getStore();
@@ -189,14 +151,34 @@ Ext.define('saas.view.core.report.ReportPanel', {
         }
     },
 
-    getListGrid: function() {
+    getListGrid: function () {
         var me = this,
-        grid = me.items.items[1];
+            grid = me.items.items[1];
 
         return grid;
     },
 
-    initStore: function() {
+    initFeatures: function () {
+        var me = this;
+        var f = [{
+            ftype: 'groupingsummary',
+            hideGroupedHeader: false,
+            enableGroupingMenu: false,
+            collapsible: false
+        }];
+
+        if (me.showMySummary) {
+            f.push({
+                ftype: 'mysummary',
+                dock: 'bottom',
+                hidden: !me.showMySummary
+            });
+        }
+
+        return f;
+    },
+
+    initStore: function () {
         var me = this;
         var store = Ext.create('Ext.data.Store', {
             fields: me.getFields(),
@@ -207,57 +189,67 @@ Ext.define('saas.view.core.report.ReportPanel', {
             proxy: {
                 type: 'ajax',
                 url: me.listUrl,
-                timeout: 8000,
+                timeout: 30000,
                 actionMethods: {
                     read: 'GET'
                 },
                 reader: {
                     type: 'json',
                     // rootProperty: 'data.list',
-                    rootProperty: function(data) {
+                    rootProperty: function (data) {
                         try {
                             var grid = me.items.items[1],
-                            columns = grid.columns,
-                            summaryData = data.data ? (data.data.calculate || []) : [];
-    
-                            Ext.Array.each(columns, function(c) {
+                                store = grid.store,
+                                columns = grid.columns,
+                                summaryData = data.data ? (data.data.calculate || []) : [],
+                                datas = data.data ? (data.data.list ? data.data.list.list : []) : [];
+
+                            Ext.Array.each(columns, function (c) {
                                 var type = c.summaryType,
-                                name = c.dataIndex;
-    
-                                var d = Ext.Array.findBy(summaryData, function(s) {
+                                    name = c.dataIndex;
+
+                                var d = Ext.Array.findBy(summaryData, function (s) {
                                     return s.hasOwnProperty(name);
                                 })
-                                if(type && d) {
-                                    if(type == 'count') {
+                                if (type && d) {
+                                    if(typeof c.mySummaryRenderer == 'function') {
+                                        c.summaryValue = c.mySummaryRenderer(grid, datas);
+                                    }else if (type == 'count') {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
-                                    }else if(typeof c.summaryRenderer == 'function') {
+                                    } else if (typeof c.summaryRenderer == 'function') {
                                         c.summaryValue = c.summaryRenderer(d[name]);
-                                    }else if(typeof c.renderer == 'function') {
+                                    } else if (typeof c.renderer == 'function') {
                                         c.summaryValue = c.renderer(d[name]);
-                                    }else {
+                                    } else {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
                                     }
-                                }else {
-                                    c.summaryValue = 0;
+                                } else if(type && !d) {
+                                    if(typeof c.mySummaryRenderer == 'function') {
+                                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
+                                    }else {
+                                        c.summaryValue = me.getSummaryValue(datas, c);
+                                    }
+                                } else {
+                                    c.summaryValue = null;
                                 }
                             });
-                            return data.data ? (data.data.list ? data.data.list.list : []) : [];
-                        }catch(e) {
+                            return datas;
+                        } catch (e) {
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }
                     },
                     totalProperty: 'data.list.total',
                 },
                 listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
+                    exception: function (proxy, response, operation, eOpts) {
+                        if (operation.success) {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
                             }
-                        }else {
-                            if(response.timedout) {
+                        } else {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
-                            }else{
+                            } else {
                                 saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
                             }
                         }
@@ -267,10 +259,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
             listeners: {
                 beforeload: function (store, op) {
                     var condition = me.getConditions(),
-                    defaultCondition = me.defaultCondition,
-                    summarys = me.summarys;
-    
-                    if(defaultCondition) {
+                        defaultCondition = me.defaultCondition,
+                        summarys = me.summarys;
+
+                    if (defaultCondition) {
                         condition.push({
                             type: 'condition',
                             value: defaultCondition
@@ -278,19 +270,19 @@ 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,
+                        number: store.exportNumber ? store.exportNumber : op._page,
+                        size: store.exportPageSize ? store.exportPageSize : store.pageSize,
                         mode: me.queryMode || 'DETAIL',
                         condition: JSON.stringify(condition),
                         calculateFields: JSON.stringify(summarys)
                     });
                     Ext.apply(store.proxy.extraParams, params);
-    
+
                 }
             }
         });
 
-        if(me.groupField) {
+        if (me.groupField) {
             store.setGrouper({
                 property: me.groupField
             });
@@ -299,26 +291,26 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return store;
     },
 
-    getFields: function() {
+    getFields: function () {
         var me = this;
-        return me.reportColumns.filter(function(c) {
+        return me.reportColumns.filter(function (c) {
             return !!c.dataIndex;
-        }).map(function(c) {
+        }).map(function (c) {
             return c.dataIndex;
         });
     },
 
-    initColumns: function() {
+    initColumns: function () {
         var me = this,
-        columns = me.reportColumns,
-        summarys = [];
+            columns = me.reportColumns,
+            summarys = [];
 
-        Ext.Array.each(columns, function(c) {
+        Ext.Array.each(columns, function (c) {
             c.columns || Ext.applyIf(c, {
                 width: 110
             });
 
-            if(c.xtype == 'datecolumn') {
+            if (c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
                     // 这两个都要写上,才能控制到不同类型的导出格式,原因不明- -!
                     format: 'Y-m-d',
@@ -330,14 +322,14 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
                     },
                     // 下面这个方法不写会造成日期列求和,原因不明- -!
-                    exportSummaryRenderer: function(v) {
+                    exportSummaryRenderer: function (v) {
                         return v;
                     }
                 })
-            }else if(c.xtype == 'numbercolumn') {
+            } else if (c.xtype == 'numbercolumn') {
                 Ext.applyIf(c, {
                     align: 'end', // 数字右对齐
-                    renderer : function(v) {
+                    renderer: function (v) {
                         var arr = (v + '.').split('.');
                         var xr = (new Array(arr[1].length)).fill('0');
                         var format = '0.' + xr.join();
@@ -346,11 +338,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 });
             }
 
-            if(c.summaryType) {
+            if (c.summaryType) {
                 me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
-                    operation: c.summaryTypeName,
+                    operation: c.summaryType == 'last' ? 'sum' : c.summaryType,
                 });
             }
         })
@@ -360,64 +352,69 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return columns;
     },
 
-    initSummaryType: function(column) {
+    initSummaryType: function (column) {
         var summaryType = column.summaryType;
-        if(Ext.isString(summaryType)) {
+        if (Ext.isString(summaryType)) {
             column.summaryTypeName = summaryType;
         }
-        if(summaryType == 'sum') {
+        if (summaryType == 'sum') {
             column._summaryType = 'sum';
             // 原生的求和方法使用的是Store.sum,在数据存在null时计算结果为NaN,这里重写一下
-            column.summaryType = function(records, values) {
+            column.summaryType = function (records, values) {
                 return Ext.Array.sum(values);
             }
+        } else if(summaryType == 'last') {
+            column._summaryType = 'last';
+            column.summaryType = function (records, values) {
+                return values[values.length - 1];
+            }
         }
     },
 
-    initSearchItems: function() {
+    initSearchItems: function () {
         var me = this,
-        queryItems = [],
-        items = me.searchItems,
-        viewModel = me.getViewModel();
+            queryItems = [],
+            items = me.searchItems,
+            viewModel = me.getViewModel();
 
-        Ext.Array.each(items, function(item) {
+        Ext.Array.each(items, function (item) {
             var bind = item.bind,
-            name = item.name,
-            ignore = item.ignore,
-            defaultValue = item.defaultValue;
+                name = item.name,
+                ignore = item.ignore,
+                defaultValue = item.defaultValue;
 
-            if(item.allowBlank==false){
+            if (item.allowBlank == false) {
                 // TODO 需要判断类型
                 item.beforeLabelTextTpl = "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>";
             }
 
-            if(!ignore) {
+            if (!ignore) {
                 queryItems.push(name);
             }
 
-            if(item.xtype == 'numberfield') {
+            if (item.xtype == 'numberfield') {
                 Ext.applyIf(item, {
                     hideTrigger: true, // 隐藏trigger
                     mouseWheelEnabled: false // 取消滚轮事件
                 });
             }
             // 设置model绑定
-            if(bind) {
-                if(!Ext.isString(bind)) {
+            if (bind) {
+                if (!Ext.isString(bind)) {
                     bind = name;
                     Ext.apply(bind, {
                         value: '{form.' + bind + '}'
                     });
-                }else {
+                } else {
                     bind = name;
                     item.bind = '{form.' + bind + '}';
                 }
-            }else {
+            } else {
                 bind = name;
                 item.bind = '{form.' + bind + '}';
             }
             // 设置默认值
-            if(defaultValue) {
+            if (defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
 
@@ -425,11 +422,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
             item.listeners = item.listeners || {};
             Ext.applyIf(item.listeners, {
                 keydown: {
-                    fn: function(th, e, eOpts) {
-                        if(e.keyCode == 13) {
-                            if(!th.fireEvent('beforequery', th)) {
+                    fn: function (th, e, eOpts) {
+                        if (e.keyCode == 13) {
+                            if (!th.fireEvent('beforequery', th)) {
                                 return;
-                            }else {
+                            } else {
                                 var p = this.up('core-report-reportpanel');
                                 p.getController().onQuery()
                             }
@@ -444,42 +441,60 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return items;
     },
 
-    getConditions: function() {
+    getSummaryValue: function(datas, c) {
+        var dataIndex = c.dataIndex,
+        type = c.summaryType,
+        values = datas.map(function(d) {
+            return d[c.dataIndex];
+        }),
+        sum = Ext.Array.sum(values);
+        if (type == 'count') {
+            return Ext.util.Format.number(values.length, '0');
+        } else if (typeof c.summaryRenderer == 'function') {
+            return c.summaryRenderer(sum);
+        } else if (typeof c.renderer == 'function') {
+            return c.renderer(sum);
+        } else {
+            return Ext.util.Format.number(sum, c.format || '0.00');
+        }
+    },
+
+    getConditions: function () {
         var me = this,
-        form = me.down('form'),
-        formItems = form.items.items,
-        viewModel = me.getViewModel(),
-        viewModelData = viewModel.getData(),
-        formData = viewModelData['form'] || {},
-        queryItems = me.queryItems,
-        condition,
-        conditions = [];
-
-        for(var i = 0; i < queryItems.length; i++) {
+            form = me.down('form'),
+            formItems = form.items.items,
+            viewModel = me.getViewModel(),
+            viewModelData = viewModel.getData(),
+            formData = viewModelData['form'] || {},
+            queryItems = me.queryItems,
+            condition,
+            conditions = [];
+
+        for (var i = 0; i < queryItems.length; i++) {
             var n = queryItems[i];
-            var item = Ext.Array.findBy(formItems, function(i) {
+            var item = Ext.Array.findBy(formItems, function (i) {
                 return i.name == n;
             });
             var field = item.name,
-            func = item.getCondition,
-            value = formData[n],
-            condition;
+                func = item.getCondition,
+                value = formData[n],
+                condition;
 
-            if(!value) {
+            if (!value) {
                 continue;
             }
 
-            if(typeof func == 'function') {
+            if (typeof func == 'function') {
                 condition = {
                     type: 'condition',
                     value: func(value)
                 }
-            }else {
+            } else {
                 type = item.fieldType || me.getDefaultFieldType(item),
-                operation = item.operation || me.getDefaultFieldOperation(item),
-                conditionValue = me.getConditionValue(item, value);
-    
-                if(!conditionValue) {
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+
+                if (!conditionValue) {
                     continue;
                 }
                 condition = {
@@ -495,24 +510,24 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return me.myGetConditions(conditions);
     },
 
-    myGetConditions: function(conditions) {
+    myGetConditions: function (conditions) {
         return conditions;
     },
 
-    getDefaultFieldType: function(field) {
+    getDefaultFieldType: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        type;
+            xtypes = field.getXTypes().split('/'),
+            type;
 
-        if(me.isContainsAny(xtypes, ['numberfield'])) {
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             type = 'string';
-        }else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
-        }else {
+        } else {
             type = 'string';
         }
 
@@ -522,28 +537,30 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 只要arr1和arr2中存在相同项即返回真
      */
-    isContainsAny: function(arr1, arr2) {
-        for(var i = 0; i < arr2.length; i++) {
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
             var a2 = arr2[i];
-            if(!!arr1.find(function(a1) {return a1==a2})) {
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
                 return true;
             }
         }
         return false;
     },
 
-    getDefaultFieldOperation: function(field) {
+    getDefaultFieldOperation: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        operation;
+            xtypes = field.getXTypes().split('/'),
+            operation;
 
-        if(me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
-        }else if(me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
-        }else {
+        } else {
             operation = 'like';
         }
 
@@ -553,38 +570,38 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(field, value) {
+    getConditionValue: function (field, value) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        conditionValue;
-        if(me.isContainsAny(xtypes, ['datefield'])) {
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(me.isContainsAny(xtypes, ['conmonthfield'])) {
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
 
             conditionValue = from + ',' + to;
-        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
 
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             conditionValue = value;
-        }else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function(v) {
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
                 return '\'' + v.value + '\'';
             }).join(',') : '';
-        }else {
+        } else {
             conditionValue = value;
         }
 
         return conditionValue;
     },
 
-    applyParams: function(p) {
+    applyParams: function (p) {
         return p;
     }
 });

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

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.bankinformation.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-bankinformation-window',
     dataKind:'bankinformation',//类型标识
+    caller:'BankInformation',
     belong:{
         columns: [{
             text: '账户编号',

+ 4 - 6
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -10,8 +10,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "bo_mothercode", 
-        width:150, 
-        emptyText:'产品',
+        width:200, 
+        emptyText:'请输入产品编号或名称',
         getCondition: function(value) {
            return  ' (bo_mothername like\'%' + value + '%\'' 
                 +' or bo_mothercode like \'%'+value+'%\' ) ';
@@ -19,17 +19,15 @@ Ext.define('saas.view.document.bom.BasePanel', {
     },{
         xtype : "textfield", 
         name : "bo_version", 
-        width:110, 
-        emptyText:'版本'
+        fieldLabel:'版本'
     },{
         xtype: 'combobox',
         name: 'bo_statuscode',
         queryMode: 'local',
         displayField: 'bo_status',
         valueField: 'bo_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['bo_statuscode', 'bo_status'],
         data: [

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

@@ -49,12 +49,6 @@ Ext.define('saas.view.document.bom.FormController', {
                         dbfinds:[
                         {
                             from:'pr_code',to:'bd_replace'                          
-                        },{
-                            from:'pr_detail',to:'pr_detail'
-                        },{
-                            from:'pr_spec',to:'pr_spec'
-                        },{
-                            from:'pr_unit',to:'pr_unit'
                         }],
                     }) ;   
                 }

+ 8 - 13
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -11,34 +11,29 @@ Ext.define('saas.view.document.customer.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "cu_code", 
-        width:150, 
-        emptyText:'编号'
+        width:200, 
+        emptyText:'请输入客户编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     }, {
-        xtype : "textfield", 
-        name : "cu_name", 
-        width:150, 
-        emptyText:'名称'
-    },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
-        emptyText : "客户类型", 
-        width:110,
+        fieldLabel : "客户类型", 
         hiddenBtn:true
     }, {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
-        width:150, 
-        emptyText:'业务员'
+        fieldLabel:'业务员'
     },{
         xtype: 'combobox',
         name: 'cu_statuscode',
         queryMode: 'local',
         displayField: 'cu_status',
         valueField: 'cu_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['cu_statuscode', 'cu_status'],
         data: [

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

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.employee.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-employee-window',
     dataKind:'employee',//类型标识
+    caller:'Employee',
     belong:{
         columns: [{
             text: '人员编号',

+ 7 - 3
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -24,7 +24,7 @@ Ext.define('saas.view.document.kind.ChildForm', {
                 codeField = item.name
             }
           });
-          if(count!=0&&count<4){
+          if(count!=0&&count<6){
             w.setHeight(114+40*count)
           }
           if(w.record){
@@ -208,9 +208,13 @@ Ext.define('saas.view.document.kind.ChildForm', {
         .then(function(localJson) {
             me.setLoading(false);
             if(localJson.success){
-                var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
+                var grid = form.ownerCt._parent;
                 if(grid){
-                    grid.store.load();
+                    if(form.ownerCt._parent.lookup('document-kind-Grid')!=null){
+                        form.ownerCt._parent.lookup('document-kind-Grid').store.load()
+                    }else{
+                        grid.store.load();
+                    }
                 }
                 if(relativeField&&relativeValue&&form.ownerCt._parent){
                     var grid = form.ownerCt._parent.down('grid');

+ 4 - 14
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -12,9 +12,9 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "textfield", 
         name : "pr_code", 
         width:300, 
-        emptyText:'输入物料编号、名称、型号或规格',
+        emptyText:'输入物料编号、名称、型号、规格或品牌',
         getCondition: function (v) {
-            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''))) like '%" + v.toUpperCase() + "%')";
+            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
         },
     },{
         editable:true,
@@ -22,24 +22,14 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_kind", 
-        emptyText : "物料类型",
-        width:130
-    }, {
-        editable:true,
-        hiddenBtn:true,
-        xtype : "remotecombo",
-        storeUrl:'/api/document/productbrand/getCombo',
-        name : "pr_brand", 
-        emptyText : "品牌", 
-        width:120
+        fieldLabel : '物料类型'
     }, {
         xtype: 'combobox',
         name: 'pr_statuscode',
         queryMode: 'local',
         displayField: 'pr_status',
         valueField: 'pr_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['pr_statuscode', 'pr_status'],

+ 7 - 11
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -11,19 +11,16 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     {
         xtype : "textfield", 
         name : "ve_code", 
-        width:150, 
-        emptyText:'编号'
-    }, {
-        xtype : "textfield", 
-        name : "ve_name", 
-        width:150, 
-        emptyText:'名称'
+        width:200, 
+        emptyText:'请输入供应商编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(ve_code,'#',ve_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
-        emptyText : "供应商类型", 
-        width:110,
+        fieldLabel : '供应商类型',
         hiddenBtn:true
     },{
         xtype: 'combobox',
@@ -31,8 +28,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         queryMode: 'local',
         displayField: 've_status',
         valueField: 've_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['ve_statuscode', 've_status'],

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

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.warehouse.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-warehouse-window',
     dataKind:'warehouse',//类型标识
+    caller:'WareHouse',
     belong:{
         columns: [{
             text: '编号',

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

@@ -50,7 +50,7 @@ Ext.define('saas.view.home.Home', {
         }, {
             xtype: 'month-purchase',
         }, {
-            xtype: 'month-io',
+            xtype: 'key-data',
         }]
     }, {
         xtype: 'panel',
@@ -65,10 +65,12 @@ Ext.define('saas.view.home.Home', {
             userCls: 'big-33 small-50',
         },
         items: [{
-            xtype: 'sale-trend',
+            xtype: 'month-io',
         }, {
-            xtype: 'purchase-trend'
+            xtype: 'sale-trend',
         }, {
+        //     xtype: 'purchase-trend'
+        // }, {
             xtype: 'stock-amount'
         }]
     }],

+ 82 - 21
frontend/saas-web/app/view/home/HomeModel.js

@@ -29,16 +29,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('infocard').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('infocard').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('infocard').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
 
                     if(!d) return;
                     var res = d[0].data.data || {};
@@ -65,16 +68,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_sale').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_sale').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_sale').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_sale_amount', sum)
                 }
@@ -98,16 +104,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month-purchase').setLoading(false);
+                        var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month-purchase').setLoading(true);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month-purchase').setLoading(false);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
                 }
@@ -131,16 +140,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_io').setLoading(false);
+                        var p = Ext.getCmp('month_io');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_io').setLoading(true);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_io').setLoading(false);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(false);
                     s.each(function(r) {
                         var sum = Ext.util.Format.number(r.get('main') + r.get('other'), '0.00') || 0;
                         if(r.get('x') == '收入') {
@@ -170,7 +182,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('sale_trend').setLoading(false);
+                        var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -179,10 +192,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('sale_trend').setLoading(true);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('sale_trend').setLoading(false);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -204,7 +219,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('purchase_trend').setLoading(false);
+                        var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -213,10 +229,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('purchase_trend').setLoading(true);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('purchase_trend').setLoading(false);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -238,7 +256,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('stock_amount').setLoading(false);
+                        var p = Ext.getCmp('stock_amount');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -247,10 +266,52 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('stock_amount').setLoading(true);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('stock_amount').setLoading(false);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(false);
+                }
+            } 
+        },
+
+        key_data: {
+            fields: ['name', 'value'],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://192.168.253.58:8920/homePage/keyData',
+                url: '/api/commons/homePage/keyData',
+                timeout: 8000,
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false),
+                        data = s.getAt(0) ? s.getAt(0).data : null;
+                    if(data) {
+                        delete data.id;
+                        p.updateValue(data);
+                        // Ext.getCmp('home').getViewModel().set('keydata', data);
+                    }
                 }
             } 
         },

+ 147 - 0
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -0,0 +1,147 @@
+Ext.define('saas.view.home.charts.KeyData', {
+    extend: 'Ext.panel.Panel',
+
+    xtype: 'key-data',
+    id: 'key_data',
+    cls: 'quick-graph-panel',
+
+    title: '关键数据',
+
+    layout: 'fit',
+    height: 300,
+
+    cardTpl: [
+        '<div class="x-container">',
+            '<tpl for=".">',
+                '<div class="x-box x-box-{color}">',
+                    '<div class="x-box-content">',
+                        '<tpl if="showIcon">',
+                            '<div class="x-icon x-icon-{icon}"></div>',
+                        '</tpl>',
+                        '<div class="x-text',
+                            // '<tpl if="!showIcon">',
+                            //     ' x-text-small',
+                            // '</tpl>',
+                        '">',
+                            // '<tpl if="!showIcon">',
+                            //     '<div class="x-icon-small x-icon-{icon}"></div>',
+                            // '</tpl>',
+                            '<div class="x-key"><span>{label}</span></div>',
+                            '<div class="x-value"><span>{value}</span></div>',
+                        '</div>',
+                    '</div>',
+                '</div>',
+            '</tpl>',
+        '</div>'
+    ],
+
+    cards: [{
+        color: 'green',
+        showIcon: true,
+        icon: 'storageTotal',
+        name: 'storageTotal',
+        label: '库存总额',
+        value: '0',
+        viewType: 'stock-report-datalist',
+        title: '物料库存数量金额表查询',
+        id: 'stock-report-datalist',
+    }, {
+        color: 'yellow',
+        showIcon: true,
+        icon: 'receiveTotal',
+        name: 'receiveTotal',
+        label: '应收总额',
+        value: '0',
+        viewType: 'monry-report-totalrecdetail',
+        title: '应收总账查询',
+        id: 'monry-report-totalrecdetail',
+    }, {
+        color: 'red',
+        showIcon: true,
+        icon: 'payTotal',
+        name: 'payTotal',
+        label: '应付总额',
+        value: '0',
+        viewType: 'monry-report-totalpaydetail',
+        title: '应付总账查询',
+        id: 'monry-report-totalpaydetail',
+    }, {
+        color: 'blue',
+        showIcon: true,
+        icon: 'balanceTotal',
+        name: 'balanceTotal',
+        label: '账户余额',
+        value: '0',
+        viewType: 'document-bankinformation-datalist',
+        title: '资金账户查询',
+        id: 'document-bankinformation-datalist',
+    }],
+
+    initComponent: function () {
+        var me = this;
+
+        var store = Ext.create('Ext.data.Store', {
+            fields: ['color', 'showIcon', 'icon', 'label', 'value'],
+            data: me.cards,
+            updateValue: function(datas) {
+                this.each(function(r, index) {
+                    // var v = datas[r.get('name')];
+                    // var d = saas.util.BaseUtil.formatAmount(v);
+                    var d = Ext.util.Format.number(datas[r.get('name')], '0,000.00');
+                    r.set('value', d);
+                });
+            },
+            // updateShowIcon: function(show) {
+            //     this.each(function(r) {
+            //         r.set('showIcon', show);
+            //     });
+            // }
+        });
+        var view = Ext.create('Ext.view.View', {
+            store: store,
+            tpl: new Ext.XTemplate(me.cardTpl),
+            itemSelector: 'div.x-box',
+            listeners: {
+                itemclick: function(th, record, item, index, e, eOpts) {
+                    saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
+                }
+            }
+        });
+
+        Ext.apply(me, {
+            items: [view]
+        });
+
+        me.view = view;
+
+        me.callParent(arguments);
+    },
+
+    listeners: {
+        // afterlayout: function() {
+        //     var me = this,
+        //     box = me.getBox(),
+        //     view = me.view,
+        //     width = box.width,
+        //     store = view.store;
+
+        //     store.updateShowIcon(width >= 450);
+        // },
+    },
+
+    updateValue: function(datas) {
+        var me = this,
+        view = me.view,
+        store = view.store;
+
+        store.updateValue(datas);
+    },
+
+    // updateShowIcon: function(showIcon) {
+    //     var me = this,
+    //     view = me.view,
+    //     store = view.store;
+
+    //     store.updateShowIcon(showIcon);
+    // }
+});

+ 111 - 0
frontend/saas-web/app/view/home/charts/KeyData.scss

@@ -0,0 +1,111 @@
+#key_data {
+    .key_data-body {
+        padding: 0;
+    }
+    .x-container {
+        height: 100%;
+        display: flex;
+        flex-wrap: wrap;
+
+        .x-box {
+            width: calc(50% - 16px);
+            border-width: 5px 1px 1px;
+            border-style: solid;
+            border-color: #1EC09F;
+            cursor: pointer;
+
+            &:nth-of-type(odd) {
+                margin: 8px 8px 8px 0;
+            }
+
+            &:nth-of-type(even) {
+                margin: 8px 0 8px 8px;
+            }
+
+            .x-box-content {
+                display: flex;
+                height: 100%;
+                padding: 16px;
+
+                .x-icon {
+                    flex: 4;
+                    max-width: 48px;
+                    background-repeat: no-repeat;
+                    background-size: contain;
+                    background-position: center;
+
+                    &-small {
+                        width: 36px;
+                        height: 36px;
+                        position: relative;
+                        background-repeat: no-repeat;
+                        background-size: contain; 
+                    }
+
+                    &-storageTotal {
+                        background-image: url(/resources/images/home/storageTotal.png);
+                    }
+                    &-receiveTotal {
+                        background-image: url(/resources/images/home/receiveTotal.png);
+                    }
+                    &-payTotal {
+                        background-image: url(/resources/images/home/payTotal.png);
+                    }
+                    &-balanceTotal {
+                        background-image: url(/resources/images/home/balanceTotal.png);
+                    }
+                }
+
+                .x-text {
+                    flex: 6;
+                    display: flex;
+                    color: #485465;
+                    flex-direction: column;
+                    align-items: flex-end;
+                    overflow: hidden;
+
+                    .x-key {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-end;
+                        margin-bottom: 5px;
+                        font-size: 14px;
+                        color: #485465;
+                    }
+                
+                    .x-value {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-start;
+                        font-size: 16px;
+                        color: #1E2429;
+                    }
+
+                    &-small {
+                        display: block;
+
+                        .x-key {
+                            display: block;
+                            padding-left: 54px;
+                            margin-top: -17px;
+                            margin-bottom: 14px;
+                        }
+                    }
+                }
+            }
+        }
+
+        .x-box-green {
+            border-color: #1EC09F;
+        }
+        .x-box-yellow {
+            border-color: #FDC200;
+        }
+        .x-box-red {
+            border-color: #FB6A83;
+        }
+        .x-box-blue {
+            border-color: #62A3DF;
+        }
+    }
+}

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

@@ -2,7 +2,7 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
     extend: 'saas.view.core.chart.ChartBase',
     xtype: 'month-purchase',
 
-    id: 'month-purchase',
+    id: 'month_purchase',
 
     bind: {
         title: '本月采购额(万元):{month_purchase_amount}'

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

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.PurchaseIn', {
     codeField: 'pu_code',
     detailTitle: '采购订单',
     detailXType: 'purchase-purchase-formpanel',
-    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)',
+    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pu_acceptstatus,\' \') <> \'已入库\')',
     listColumns: [{
         text: 'id',
         dataIndex: 'pu_id',

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

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.SaleOut', {
     codeField: 'sa_code',
     detailTitle: '销售订单',
     detailXType: 'sale-sale-formpanel',
-    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)',
+    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sa_sendstatus,\' \') <> \'已出库\' ',
     listColumns: [{
         text: 'id',
         dataIndex: 'sa_id',

+ 1 - 1
frontend/saas-web/app/view/main/Main.js

@@ -31,7 +31,7 @@ Ext.define('saas.view.main.Main', {
                     reference: 'mainLogo',
                     width: 180,
                     cls: 'main-logo-wrap',
-                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">U企云服</div></div>',
+                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">企云服</div></div>',
                     bind: {
                         width: '{navWidth}'
                     }

+ 2 - 2
frontend/saas-web/app/view/main/Main.scss

@@ -69,7 +69,7 @@ $treelist-nav-ui: (
             width: 32px;
             height: 32px;
             top: 16px;
-            left: 42px;
+            left: 28px;
             position: relative;
         }
 
@@ -80,7 +80,7 @@ $treelist-nav-ui: (
             text-align: left;
             top: 30px;
             position: absolute;
-            left: 76px;
+            left: 64px;
         }
     }
 }

+ 2 - 2
frontend/saas-web/app/view/main/MainController.js

@@ -35,13 +35,13 @@ Ext.define('saas.view.main.MainController', {
         navigationList = refs.navigationTreeList,
         navCollapsed = !navigationList.navCollapsed,
         new_width = navCollapsed ? viewModel.get('smallNavWidth') : viewModel.get('navWidth'),
-        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 42 },
+        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 28 },
         newLogoTextStyle = navCollapsed ? {
             5: { opacity: 0 },
             10: { opacity: 0 },
             100: { opacity: 0, display: 'none' }
         } : {
-            25: { opacity: 0 },
+            10: { opacity: 0 },
             50: { opacity: 1 }
         },
         newNavIconStyle = navCollapsed ? { marginLeft: 6, fontSize: 28 } : { marginLeft: 22, fontSize: 24 },

+ 1 - 1
frontend/saas-web/app/view/main/MainModel.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.main.MainModel', {
     alias: 'viewmodel.main',
 
     data: {
-        navWidth: 180,
+        navWidth: 160,
         smallNavWidth: 64,
     }
 });

+ 1 - 0
frontend/saas-web/app/view/main/Navigation.scss

@@ -146,6 +146,7 @@ $nav-font-color-over: #fff;
                     height: 40px;
                     line-height: 40px;
                     font-size: 16px;
+                    font-weight: bold;
                     color: #4F5170;
                     letter-spacing: 0.64px;
                     text-align: left;

+ 124 - 0
frontend/saas-web/app/view/money/report/OtherIODetail.js

@@ -0,0 +1,124 @@
+/**
+ * 其他收支明细表
+ */
+Ext.define('saas.view.money.report.OtherIODetail', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'monry-report-otheriodetail',
+
+    controller: 'money-report-otheriodetail',
+    viewModel: 'money-report-otheriodetail',
+
+    viewName: 'money-report-otheriodetail',
+
+    groupField: 'bl_bankname',
+    listUrl: '/api/money/report/otheriodetail',
+    defaultCondition: null,
+    reportTitle: '其他收支明细表',
+    QueryWidth: 0.2,
+    searchItems: [{
+        xtype: 'bandinfoDbfindTrigger',
+        name: 'bl_bankname',
+        emptyText: '资金账户',
+        columnWidth: 0.15,
+        dbfinds:[
+            {
+                from:'bk_bankname',to:'bl_bankname'
+            }]
+    }, {
+        // xtype : "remotecombo",
+        // storeUrl:'/api/document/customerkind/getCombo',
+        // name : "bl_kind",
+        // emptyText : "收支类别",
+        // columnWidth: 0.25,
+        // hiddenBtn:true,
+        xtype: 'combobox',
+        name: 'bl_kind',
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        emptyText : '收支类别',
+        editable:false,
+        columnWidth: 0.15,
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['value', 'display'],
+            data: [
+                ["ALL", "全部"],
+                ["其他支出单", "其他支出单"],
+                ["其他收入单", "其他收入单"]
+            ]
+        }),
+        getCondition: function(value) {
+            if(value == 'ALL'||value == null) {
+                return '1=1';
+            }else {
+                return 'bl_kind=\'' + value + '\'';
+            }
+        }
+
+    }, {
+        xtype: 'condatefield',
+        name: 'bl_date',
+        fieldLabel: '日期',
+        columnWidth: 0.5
+    }],
+
+    reportColumns: [{
+        text: '日期',
+        dataIndex: 'bl_date',
+        width: 200
+    }, {
+        text: '单据编号',
+        dataIndex: 'bl_code',
+        width: 200,
+    }, {
+        text: '收支类别',
+        dataIndex: 'bl_kind',
+        width: 200,
+    }, {
+        text: '资金账户',
+        dataIndex: 'bl_bankname',
+        width: 150
+    }, {
+        text: '收入',
+        dataIndex: 'bl_income',
+        width: 150,
+        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);
+        },
+        summaryType: 'sum',
+        summaryRenderer: 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);
+        }
+    }, {
+        text: '支出',
+        dataIndex: 'bl_spending',
+        width: 150,
+        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);
+        },
+        summaryType: 'sum',
+        summaryRenderer: 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);
+        }
+    }, {
+        text: '往来单位',
+        dataIndex: 'bl_assname',
+        width: 150,
+    }, {
+        text: '备注',
+        dataIndex: 'bl_remark',
+        width: 150
+    }]
+});

+ 5 - 0
frontend/saas-web/app/view/money/report/OtherIODetailController.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.money.report.OtherIODetailController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.money-report-otheriodetail',
+    
+});

+ 4 - 0
frontend/saas-web/app/view/money/report/OtherIODetailModel.js

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

+ 50 - 45
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -6,56 +6,62 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pi_vendname',
+    groupField:'pd_vendname',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
     QueryWidth:0.25,
+    allowPaging: false,
+
     //筛选:供应商、日期(必填)
     searchItems: [ {
         xtype: 'vendorDbfindTrigger',
-        name: 'pi_vendname',
+        name: 'pd_vendname',
         fieldLabel: '供应商名称',
         columnWidth: 0.25
     }, {
-        xtype: 'condatefield',
-        name: 'pb_date',
-        fieldLabel: '单据日期',
+        xtype: 'conmonthfield',
+        name: 'pd_ym',
+        fieldLabel: '期',
         columnWidth: 0.5
     }],
 
     reportColumns: [
         {
             text: 'id',
-            dataIndex: 'pi_id',
+            dataIndex: 'pd_id',
             hidden: true
         }, {
             text: '单据日期',
             xtype: 'datecolumn',
-            dataIndex: 'pb_date',
+            dataIndex: 'pd_date',
             width: 110
         }, {
             text: '单号',
-            dataIndex: 'pi_inoutno',
+            dataIndex: 'pd_code',
             width: 150
+        }, {
+            text: '单据类型',
+            dataIndex: 'pd_kind',
+            width: 110
         }, {
             text:'供应商编号',
-            dataIndex:'pi_vendcode',
+            dataIndex:'pd_vendcode',
             width: 150,
             hidden: true
         },{
             text:'供应商名称',
             width: 200,
-            dataIndex:'pi_vendname',
+            dataIndex:'pd_vendname',
             hidden: true
         },{
             text: '采购员',
-            dataIndex: 'pu_buyercode',
+            dataIndex: 'pd_buyername',
             width: 110
         },{
-            text: '期初应付余额',
+            text: '增加应付',
             xtype: 'numbercolumn',
-            dataIndex: 've_beginapamount',
+            dataIndex: 'pd_addpay',
             xtype: 'numbercolumn',
             width: 180,
             renderer : function(v) {
@@ -72,9 +78,9 @@ Ext.define('saas.view.money.report.PayDetail', {
                 return Ext.util.Format.number(v, format);
             }
         }, {
-            text: '本期付款金额',
+            text: '增加预付',
             xtype: 'numbercolumn',
-            dataIndex: 'pb_pdamount',
+            dataIndex: 'pd_addpre',
             xtype: 'numbercolumn',
             width: 180,
             renderer : function(v) {
@@ -93,7 +99,7 @@ Ext.define('saas.view.money.report.PayDetail', {
         }, {
             text: '应付余额',
             xtype: 'numbercolumn',
-            dataIndex: 'mustpay',
+            dataIndex: 'pd_remain',
             xtype: 'numbercolumn',
             width: 110,
             renderer : function(v) {
@@ -102,44 +108,43 @@ Ext.define('saas.view.money.report.PayDetail', {
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
             },
-            summaryType: 'sum',
+            summaryType: 'last',
             summaryRenderer: 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);
-            }
-        }, {
-            text: '应付日期',
-            xtype: 'datecolumn',
-            dataIndex: 'mustdate',
-            width: 110
-        }, {
-            text: '单据总金额',
-            xtype: 'numbercolumn',
-            width: 110,
-            dataIndex: 'pi_total',
-            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);
             },
-            summaryType: 'sum',
-            summaryRenderer: 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);
+            mySummaryRenderer: function(grid, column, datas) {
+                var store = grid.store,
+                dataIndex = column.dataIndex,
+                groupField = store.getGroupField(),
+                count = datas.length,
+                data = datas,
+                lasts = {},
+                keys = [],
+                arr = [];
+
+                for(var i = 0; i < count; i++) {
+                    var d = data[i];
+                    var n = Number(d[dataIndex]);
+                    var v = isNaN(n) ? 0 : n;
+
+                    lasts[groupField] = v;
+                }
+
+                keys = Ext.Object.getAllKeys(lasts);
+                arr = keys.map(function(key) {
+                    return lasts[key];
+                });
+
+                return Ext.Array.sum(arr);
             }
-        }, {
-            text: '备注',
-            dataIndex: 'pi_remark',
-            width: 250
         }, {
             text: '供应商名称',
-            dataIndex: 'pi_vendname',
+            dataIndex: 'pd_vendname',
             hidden:true
+        }, {
+            flex: 1
         }]
 });

+ 2 - 2
frontend/saas-web/app/view/money/report/PayDetailController.js

@@ -4,11 +4,11 @@ Ext.define('saas.view.money.report.PayDetailController', {
     init: function (form) {
         this.control({
             // 供应商编号
-            'dbfindtrigger[name=pi_vendname]':{
+            'dbfindtrigger[name=pd_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dbfinds:[{
-                            from:'ve_name',to:'pi_vendname'
+                            from:'ve_name',to:'pd_vendname'
                         }],
                     }) ;
 

+ 70 - 0
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -0,0 +1,70 @@
+/**
+ * 毛利润分析表
+ */
+Ext.define('saas.view.money.report.ProfitDetail', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'monry-report-profitdetail',
+
+    controller: 'money-report-profitdetail',
+    viewModel: 'money-report-profitdetail',
+
+    viewName: 'money-report-profitdetail',
+
+    groupField: null,
+    listUrl: '/api/money/report/recDetail',
+    defaultCondition: null,
+    reportTitle: '毛利润分析表',
+    QueryWidth: 0.25,
+    searchItems: [{
+        xtype: 'customerDbfindTrigger',
+        name: 'pi_custname',
+        fieldLabel: '客户名称',
+        columnWidth: 0.25
+    }, {
+        xtype : "remotecombo", 
+        storeUrl:'/api/document/customerkind/getCombo',
+        name : "cu_type", 
+        emptyText : "客户类型", 
+        columnWidth: 0.25,
+        hiddenBtn:true
+    }, {
+        xtype: 'condatefield',
+        name: 'rb_date',
+        fieldLabel: '日期',
+        columnWidth: 0.25
+    }],
+
+    reportColumns: [{
+        text: '客户编号',
+        dataIndex: 'pi_inoutno',
+        width: 200
+    }, {
+        text: '客户类型',
+        dataIndex: 'pi_custcode',
+        width: 200,
+    }, {
+        text: '业务员',
+        dataIndex: 'pi_custname',
+        width: 200,
+    }, {
+        text: '销售总额',
+        dataIndex: 'pi_class',
+        width: 150
+    }, {
+        text: '不含税金额',
+        dataIndex: 'pu_buyername',
+        width: 150
+    }, {
+        text: '成本金额',
+        dataIndex: 'rb_date',
+        width: 150
+    }, {
+        text: '毛利润',
+        dataIndex: 'pd_pdno',
+        width: 150,
+    }, {
+        text: '毛利率',
+        dataIndex: 'cu_beginaramount',
+        width: 150
+    }]
+});

+ 4 - 0
frontend/saas-web/app/view/money/report/ProfitDetailController.js

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

+ 4 - 0
frontend/saas-web/app/view/money/report/ProfitDetailModel.js

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

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

@@ -7,34 +7,45 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'pi_custname',
+    groupField: 'rd_custname',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
     QueryWidth:0.25,
+    allowPaging: false,
+
     //筛选:客户、日期(必填)
     searchItems: [ {
         xtype: 'customerDbfindTrigger',
-        name: 'pi_custname',
+        name: 'rd_custname',
         fieldLabel: '客户名称',
         columnWidth: 0.25
     }, {
-        xtype: 'condatefield',
-        name: 'rb_date',
-        fieldLabel: '单据日期',
+        xtype: 'conmonthfield',
+        name: 'rd_ym',
+        fieldLabel: '期',
         columnWidth: 0.5
     }],
 
     reportColumns: [
         {
             text: 'id',
-            dataIndex: 'pi_id',
+            dataIndex: 'rd_id',
             hidden: true
+        }, {
+            text: '单据日期',
+            xtype: 'datecolumn',
+            dataIndex: 'rd_date',
+            width: 110
         }, {
             text: '单号',
-            dataIndex: 'pi_inoutno',
+            dataIndex: 'rd_code',
             width: 150
         }, {
+            text: '单据类型',
+            dataIndex: 'rd_kind',
+            width: 110
+        },{
             text: '客户编号',
             dataIndex: 'pi_custcode',
             width: 150,
@@ -44,28 +55,19 @@ Ext.define('saas.view.money.report.RecDetail', {
             dataIndex: 'pi_custname',
             width: 200,
             hidden: true
-        },{
-            text: '单据类型',
-            dataIndex: 'pi_class',
-            width: 110
         },{
             text: '业务员',
-            dataIndex: 'pu_buyername',
-            width: 110
-        }, {
-            text: '单据日期',
-            xtype: 'datecolumn',
-            dataIndex: 'rb_date',
+            dataIndex: 'rd_sellername',
             width: 110
         }, {
             text: '序号',
-            dataIndex: 'pd_pdno',
+            dataIndex: 'rd_detno',
             xtype: 'numbercolumn',
             width: 80,
             hidden: true
         },{
-            text:'期初应收',
-            dataIndex:'cu_beginaramount',
+            text:'增加应收',
+            dataIndex:'rd_addrec',
             xtype: 'numbercolumn',
             width: 110,
             renderer : function(v) {
@@ -82,9 +84,9 @@ Ext.define('saas.view.money.report.RecDetail', {
                 return Ext.util.Format.number(v, format);
             }
         },{
-            text:'本期收款金额',
+            text:'增加预收',
             xtype: 'numbercolumn',
-            dataIndex:'rb_rdamount',
+            dataIndex:'rd_addpre',
             xtype: 'numbercolumn',
             width: 180,
             renderer : function(v) {
@@ -103,7 +105,7 @@ Ext.define('saas.view.money.report.RecDetail', {
         },{
             text: '应收余额',
             xtype: 'numbercolumn',
-            dataIndex: 'mustpay',
+            dataIndex: 'rd_remain',
             xtype: 'numbercolumn',
             width: 110,
             renderer : function(v) {
@@ -112,32 +114,43 @@ Ext.define('saas.view.money.report.RecDetail', {
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
             },
-            summaryType: 'sum',
-            summaryRenderer: 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);
-            }
-        }, {
-            text: '单据总金额',
-            dataIndex: 'pi_total',
-            xtype: 'numbercolumn',
-            width: 110,
-            summaryType: 'sum',
+            summaryType: 'last',
             summaryRenderer: 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);
+            },
+            mySummaryRenderer: function(grid, column, datas) {
+                var store = grid.store,
+                dataIndex = column.dataIndex,
+                groupField = store.getGroupField(),
+                count = datas.length,
+                data = datas,
+                lasts = {},
+                keys = [],
+                arr = [];
+
+                for(var i = 0; i < count; i++) {
+                    var d = data[i];
+                    var n = Number(d[dataIndex]);
+                    var v = isNaN(n) ? 0 : n;
+
+                    lasts[groupField] = v;
+                }
+
+                keys = Ext.Object.getAllKeys(lasts);
+                arr = keys.map(function(key) {
+                    return lasts[key];
+                });
+
+                return Ext.Array.sum(arr);
             }
-        }, {
-            text: '备注',
-            dataIndex: 'pd_unit',
-            width: 250
         }, {
             text: '客户名称',
-            dataIndex: 'pi_custname',
+            dataIndex: 'rd_custname',
             hidden:true
+        }, {
+            flex: 1
         }]
 });

+ 2 - 2
frontend/saas-web/app/view/money/report/RecDetailController.js

@@ -3,12 +3,12 @@ Ext.define('saas.view.money.report.RecDetailController', {
     alias: 'controller.money-report-recdetail',
     init: function (form) {
         this.control({
-            'dbfindtrigger[name=pi_custname]':{
+            'dbfindtrigger[name=rd_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         //赋值
                         dbfinds:[{
-                            from: 'cu_name', to: 'pi_custname'
+                            from: 'cu_name', to: 'rd_custname'
                         }],
                     }) ;
 

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

@@ -14,7 +14,7 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
     listUrl: '/api/money/report/vendormonthdetails',
     // listUrl: 'http://192.168.253.139:8560/api/money/report/vendormonthdetails',
     defaultCondition: null,
-    reportTitle: '应总账',
+    reportTitle: '应总账',
     QueryWidth: 0.35,
     allowPaging: false,
 
@@ -61,5 +61,20 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         dataIndex: 'vm_endamount',
         xtype: 'numbercolumn',
         width: 150,
+        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);
+        },
+        summaryType: 'sum',
+        summaryRenderer: 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
     }]
 });

+ 15 - 0
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -60,5 +60,20 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         dataIndex: 'cm_endamount',
         xtype: 'numbercolumn',
         width: 150,
+        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);
+        },
+        summaryType: 'sum',
+        summaryRenderer: 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
     }]
 });

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

@@ -125,7 +125,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             width: 150
         },{
             text: '总金额',
-            dataIndex: 'pd_ordertotal',
+            dataIndex: 'pi_total',
             width: 110
         },{
             text: '单据状态',

+ 3 - 2
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -65,7 +65,8 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         xtype: 'warehouseDbfindTrigger',
         name: 'pd_whname',
         fieldLabel: '仓库',
-        emptyText:'请输入仓库编号或名称'
+        emptyText:'请输入仓库编号或名称',
+        showDetail: true
     }, {
         xtype: 'textfield',
         name: 'pi_iocode',
@@ -124,7 +125,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             width: 150
         },{
             text: '总金额',
-            dataIndex: 'pd_ordertotal',
+            dataIndex: 'pi_total',
             width: 110
         },{
             text: '单据状态',

+ 36 - 15
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -47,24 +47,45 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 allowBlank : false
             }, {
                 name : "sa_toplace", 
-                xtype : "textfield", 
+                xtype : "remotecombo", 
                 fieldLabel : "交货地址", 
+                editable:false,
                 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();
+                storeUrl:'/api/document/customer/getAddressCombo',
+                hiddenBtn:true,//true 则会关闭新增按钮功能
+                setValue:function(value){
+                    var me = this,bind, valueBind;
+                    if(value&&value!=''){
+                        me.setDisabled(false);
+                    }else{
+                        me.setDisabled(true);
+                    }
+                    if (me.hasFocus) {
+                        bind = me.getBind();
+                        valueBind = bind && bind.value;
+                        if (valueBind && valueBind.syncing) {
+                            if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
+                                return me;
+                            } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
+                                return me;
+                            }
+                        }
+                    } else {
+                        me.lastSelectedRecords = null;
+                    }
+            
+                    if (value != null) {
+                        me.doSetValue(value);
+                    }
+                    else {
+                        me.suspendEvent('select');
+                        me.valueCollection.beginUpdate();
+                        me.pickerSelectionModel.deselectAll();
+                        me.valueCollection.endUpdate();
+                        me.resumeEvent('select');
+                    }
+                    return me;
                 }
             }, {
                 name : "detailGridField", 

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

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

+ 8 - 3
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -23,7 +23,8 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         xtype: 'productDbfindTrigger',
         name: 'pr_detail',
         fieldLabel: '物料',
-        showDetail: true
+        showDetail: true,
+        emptyText:'输入物料编号或名称',
     }, {
         xtype: 'combobox',
         name: 'sa_statuscode',
@@ -54,6 +55,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         fieldLabel: '业务状态',
         allowBlank: true,
         columnWidth: 0.25,
+        emptyText:'全部',
         datas: [
             ["TURNOUT", "已出库"],
             ["UNTURNOUT", "未出库"],
@@ -63,11 +65,13 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'sa_seller',
-        fieldLabel: '业务员'
+        fieldLabel: '业务员',
+        emptyText:'输入人员编号或名称',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',
         fieldLabel: '录入人',
+        emptyText:'输入人员编号或名称',
         getCondition: function(value) {
             if(!value) {
                 return '1=1';
@@ -78,7 +82,8 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'sa_auditman',
-        fieldLabel: '审核人'
+        fieldLabel: '审核人',
+        emptyText:'输入人员编号或名称',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {

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

@@ -250,13 +250,15 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             {
                 text : "销售单号", 
                 dataIndex : "pd_ordercode", 
-                width : 150.0
+                width : 150.0,
+                ignore:true
             },{
                 text : "销售序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
                 width: 110.0,
                 format: '0',
+                ignore:true,
                 renderer: function(v) {
                     return v ? v : null;
                 }

+ 4 - 4
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -52,12 +52,12 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
     }, {
         xtype: 'multicombo',
         name: 'pi_prstatuscode',
-        fieldLabel: '款状态',
+        fieldLabel: '款状态',
         emptyText :'全部',
         datas: [
-            ["PAYNONE", "未付款"],
-            ["PAYPART", "部分付款"],
-            ["PAYALL", "已付款"]
+            ["RECNONE", "未收款"],
+            ["RECPART", "部分收款"],
+            ["RECALL", "已收款"]
         ]
     }, {
         xtype: 'warehouseDbfindTrigger',

+ 1 - 1
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -52,7 +52,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     }, {
         xtype: 'multicombo',
         name: 'pi_prstatuscode',
-        fieldLabel: '款状态',
+        fieldLabel: '款状态',
         emptyText :'全部',
         datas: [
             ["RECNONE", "未收款"],

+ 35 - 2
frontend/saas-web/app/view/stock/report/DataList.js

@@ -15,6 +15,7 @@ Ext.define('saas.view.stock.report.DataList', {
     QueryWidth: 0.4,
     printAble: false,
     exportAble: true,
+    queryMode: 'MAIN',
 
     searchItems: [{
         name: 'pr_code',
@@ -33,11 +34,11 @@ Ext.define('saas.view.stock.report.DataList', {
             return "(upper(wh_code) like '%" + v.toUpperCase() + "%' or upper(wh_description) like '%" + v.toUpperCase() + "%')";
         }
     }, {
+        xtype: 'checkboxfield',
         name: 'toggle',
-        xtype: 'checkbox',
         fieldLabel: '分仓库存',
         columnWidth: 0.1,
-        labelAlign: 'left',
+        labelAlign: 'right',
         labelWidth: 70,
         ignore: true,
         listeners: {
@@ -104,6 +105,31 @@ Ext.define('saas.view.stock.report.DataList', {
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
+        summaryType: 'sum',
+        summaryRenderer: 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);
+        }
+    }, {
+        text: "金额",
+        xtype: 'numbercolumn',
+        dataIndex: "rc_amount",
+        width: 150,
+        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);
+        },
+        summaryType: 'sum',
+        summaryRenderer: 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);
+        }
     }],
 
     reportColumns: [{
@@ -145,6 +171,13 @@ Ext.define('saas.view.stock.report.DataList', {
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
+        summaryType: 'sum',
+        summaryRenderer: 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
     }],

+ 12 - 10
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -12,8 +12,19 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
     defaultCondition: null,
     reportTitle: '物料出入库明细表',
     QueryWidth:0.2,
+    showMySummary: false,
+
     //筛选:单据类型、物料、日期
-    searchItems: [{
+    searchItems: [ {		
+        xtype: 'textfield',
+        name: 'pd_prodcode',
+        fieldLabel: '',
+        emptyText:'输入单号,订单号或物料编号',
+        columnWidth: 0.2,
+        getCondition:function(v){
+            return "pd_prodcode='"+v+"' or pi_inoutno='"+v+"' or pd_ordercode='"+v+"'";
+        }
+    },{
         xtype: 'multicombo',
         name: 'pi_class',
         fieldLabel: '单据类型',
@@ -33,15 +44,6 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
             ["拨入单", "拨入单"],
             ["库存初始化","库存初始化"]
         ]
-    }, {		
-        xtype: 'textfield',
-        name: 'pd_prodcode',
-        fieldLabel: '',
-        emptyText:'输入单号,订单号或物料编号',
-        columnWidth: 0.2,
-        getCondition:function(v){
-            return "pd_prodcode='"+v+"' or pi_inoutno='"+v+"' or pd_ordercode='"+v+"'";
-        }
     }, {
         xtype: 'condatefield',
         name: 'pi_date',

+ 1 - 1
frontend/saas-web/app/view/sys/account/AddWindow.js

@@ -125,7 +125,6 @@ Ext.define('saas.view.sys.account.AddWindow', {
                         var form = f.ownerCt;
                         if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
                             form.setLoading(true);
-                            f._lastCheckValue = f.value
                             Ext.Ajax.request({
                                 url: '/api/account/account/checkEmail?email='+f.value,
                                 method: 'GET',
@@ -138,6 +137,7 @@ Ext.define('saas.view.sys.account.AddWindow', {
                                     var localJson = Ext.decode(response.responseText);
                                     if(localJson.success){
                                         if(!localJson.data){
+                                            f._lastCheckValue = f.value;
                                             saas.util.BaseUtil.showSuccessToast('校验成功:邮箱未注册');
                                         }else{
                                             saas.util.BaseUtil.showErrorToast('校验失败:该邮箱已被注册');

+ 5 - 4
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -30,12 +30,11 @@ Ext.define('Ext.ux.feature.MySummary', {
         me.callParent([grid]);
 
         grid.store.on('load', function() {
-            this.fireEvent('mysummarychange', grid);
+            this.fireEvent('mysummarychange', this);
         }, grid);
 
-        grid.on({
-            mysummarychange: me.refreshData,
-            scope: me
+        grid.on('mysummarychange', function() {
+            me.refreshData(grid); 
         });
 
         grid.on({
@@ -118,6 +117,8 @@ Ext.define('Ext.ux.feature.MySummary', {
 
         if(summarys.length == 0) {
             me.showSummaryRow = false;
+        }else {
+            me.showSummaryRow = true;
         }
 
         return summarys;

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

@@ -1,5 +1,5 @@
-.x-docked-mysummary {
-    border-color: #d0d0d0;
+div.x-component.x-docked-mysummary {
+    border-color: #999 !important;
     border-style: solid;
     background: #fff!important;
 

+ 1 - 1
frontend/saas-web/index.html

@@ -5,7 +5,7 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
 
-    <title>云进销存 - U企云服</title>
+    <title>云进销存 - 企云服</title>
     <link rel="icon" href="/resources/images/favicon.png" type="image/x-icon">
     <!-- 图片动画效果样式导入 -->
     <link type="text/css" rel="stylesheet" href="/resources/othcss/imagehover.css" />

+ 60 - 0
frontend/saas-web/overrides/ux/TabCloseMenu.js

@@ -0,0 +1,60 @@
+Ext.define('saas.override.ux.TabCloseMenu', {
+    override: 'Ext.ux.TabCloseMenu',
+
+    cls: 'x-tab-close-menu',
+
+    createMenu : function() {
+        var me = this;
+ 
+        if (!me.menu) {
+            var items = [{
+                itemId: 'close',
+                text: me.closeTabText,
+                scope: me,
+                handler: me.onClose
+            }];
+ 
+            if (me.showCloseAll || me.showCloseOthers) {
+                items.push('-');
+            }
+ 
+            if (me.showCloseOthers) {
+                items.push({
+                    itemId: 'closeOthers',
+                    text: me.closeOthersTabsText,
+                    scope: me,
+                    handler: me.onCloseOthers
+                });
+            }
+ 
+            if (me.showCloseAll) {
+                items.push({
+                    itemId: 'closeAll',
+                    text: me.closeAllTabsText,
+                    scope: me,
+                    handler: me.onCloseAll
+                });
+            }
+ 
+            if (me.extraItemsHead) {
+                items = me.extraItemsHead.concat(items);
+            }
+ 
+            if (me.extraItemsTail) {
+                items = items.concat(me.extraItemsTail);
+            }
+ 
+            me.menu = Ext.create('Ext.menu.Menu', {
+                cls: me.cls,
+                items: items,
+                listeners: {
+                    hide: me.onHideMenu,
+                    scope: me
+                }
+            });
+        }
+ 
+        return me.menu;
+    },
+
+});

BIN
frontend/saas-web/resources/images/home/balanceTotal.png


BIN
frontend/saas-web/resources/images/home/payTotal.png


BIN
frontend/saas-web/resources/images/home/receiveTotal.png


BIN
frontend/saas-web/resources/images/home/storageTotal.png


+ 8 - 4
frontend/saas-web/resources/json/navigation.json

@@ -74,6 +74,10 @@
             "text": "客户对账单",
             "id": "monry-report-customercheck",
             "viewType":"monry-report-customercheck"
+        },{
+            "text":"其他收支明细表",
+            "id":"money-report-otheriodetail",
+            "viewType":"monry-report-otheriodetail"
         }]
     }]
 }, {
@@ -165,14 +169,14 @@
             "id": "monry-report-totalrecdetail",
             "viewType":"monry-report-totalrecdetail"
         }, {
-            "text": "应付总账",
-            "id": "monry-report-totalpaydetail",
-            "viewType":"monry-report-totalpaydetail"
-        },{
             "text": "应收账款明细表",
             "id": "monry-report-recdetail",
             "viewType":"monry-report-recdetail"
         }, {
+            "text": "应付总账",
+            "id": "monry-report-totalpaydetail",
+            "viewType":"monry-report-totalpaydetail"
+        },{
             "text": "应付账款明细表",
             "id": "monry-report-paydetail",
             "viewType":"monry-report-paydetail"