Browse Source

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

jinsy 7 years ago
parent
commit
0226996598
100 changed files with 2051 additions and 934 deletions
  1. 5 5
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java
  2. 5 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  3. 10 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/HomePageController.java
  4. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/HomePageMapper.java
  5. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/HomePageService.java
  6. 7 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/HomePageServiceImpl.java
  7. 32 0
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  8. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  9. 7 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  10. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  11. 3 3
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  12. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java
  13. 11 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ProfitdetailMapper.java
  14. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java
  15. 37 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java
  16. 109 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Profitpresent.java
  17. 36 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java
  18. 7 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  19. 19 11
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  20. 5 1
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  21. 136 0
      applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml
  22. 5 1
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  23. 3 3
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  24. 4 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java
  25. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java
  26. 6 2
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  27. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  28. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java
  29. 2 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  30. 5 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  31. 3 1
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  32. 2 1
      applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml
  33. 1 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java
  34. 4 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java
  35. 18 0
      applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml
  36. 1 1
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml
  37. 12 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java
  38. 1 1
      base-servers/account/account-server/src/main/resources/application.yml
  39. 3 3
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  40. 1 1
      base-servers/auth/sso-api/src/test/resources/application.yml
  41. 19 0
      base-servers/sms/sms-server/src/main/resources/config/application-docker-prod.yml
  42. 1 1
      frontend/saas-portal-web/config/dev.env.js
  43. 1 1
      frontend/saas-portal-web/config/test.env.js
  44. 2 2
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  45. 65 0
      frontend/saas-web/app/Application.scss
  46. 34 8
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  47. 13 17
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  48. 2 2
      frontend/saas-web/app/view/core/form/field/ConDateField.js
  49. 7 0
      frontend/saas-web/app/view/core/form/field/ConMonthField.scss
  50. 3 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  51. 112 65
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  52. 115 97
      frontend/saas-web/app/view/core/query/QueryPanel.js
  53. 0 34
      frontend/saas-web/app/view/core/query/QueryPanelController.js
  54. 14 4
      frontend/saas-web/app/view/core/report/ReportPanel.js
  55. 42 0
      frontend/saas-web/app/view/document/address/DataList.js
  56. 2 1
      frontend/saas-web/app/view/document/address/DataListModel.js
  57. 4 1
      frontend/saas-web/app/view/document/bom/BasePanel.js
  58. 4 1
      frontend/saas-web/app/view/document/customer/BasePanel.js
  59. 3 1
      frontend/saas-web/app/view/document/product/BasePanel.js
  60. 2 0
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  61. 29 17
      frontend/saas-web/app/view/home/Home.js
  62. 22 54
      frontend/saas-web/app/view/home/Home.scss
  63. 106 69
      frontend/saas-web/app/view/home/HomeModel.js
  64. 47 26
      frontend/saas-web/app/view/home/charts/KeyData.js
  65. 9 0
      frontend/saas-web/app/view/home/charts/KeyData.scss
  66. 91 0
      frontend/saas-web/app/view/home/charts/ProfitDetail.js
  67. 1 1
      frontend/saas-web/app/view/home/infoCardList/Payment.js
  68. 4 1
      frontend/saas-web/app/view/home/infoCardList/Recment.js
  69. 1 1
      frontend/saas-web/app/view/main/Main.js
  70. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  71. 2 0
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  72. 2 1
      frontend/saas-web/app/view/money/report/AccountBalance.js
  73. 14 2
      frontend/saas-web/app/view/money/report/AccountDetails.js
  74. 37 17
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  75. 2 1
      frontend/saas-web/app/view/money/report/OtherIODetail.js
  76. 118 118
      frontend/saas-web/app/view/money/report/PayDetail.js
  77. 76 24
      frontend/saas-web/app/view/money/report/ProfitDetail.js
  78. 124 123
      frontend/saas-web/app/view/money/report/RecDetail.js
  79. 54 7
      frontend/saas-web/app/view/money/report/TotalPayDetail.js
  80. 47 6
      frontend/saas-web/app/view/money/report/TotalRecDetail.js
  81. 39 25
      frontend/saas-web/app/view/money/report/VendorCheck.js
  82. 16 0
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  83. 2 1
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  84. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  85. 3 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  86. 17 44
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  87. 2 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  88. 15 1
      frontend/saas-web/app/view/purchase/report/PurchasePay.js
  89. 2 2
      frontend/saas-web/app/view/sale/report/Sale.js
  90. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  91. 2 1
      frontend/saas-web/app/view/sale/report/SaleRec.js
  92. 14 12
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  93. 44 5
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  94. 20 0
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  95. 10 4
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  96. 44 5
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  97. 20 0
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  98. 8 3
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  99. 17 18
      frontend/saas-web/app/view/stock/inventory/EditDataList.js
  100. 20 62
      frontend/saas-web/app/view/stock/report/DataList.js

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

@@ -112,22 +112,22 @@ public class ListReqDTO implements Serializable {
                     }
                     if ("between".equals(operation)) {
                         String[] vals = value.toString().split(",");
-                        con = " " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' and";
+                        con = " ( " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' ) and";
                     } else if ("startsWith".equals(operation)) {
                         con = " " + field + "  like '" + value + "%' and";
                     } else if ("endsWith".equals(operation)) {
                         con = " " + field + " like '%" + value + "' and";
                     } else if ("in".equals(operation) || "not in".equals(operation)) {
-                        con = " " + field + " " + operation + " (" + value + ") and";
+                        con = " ( " + field + " " + operation + " (" + value + ") ) and";
                     } else {
                         //字符串默认是模糊查询
                         if ("string".equals(type)) {
-                            con = " " + field + " like '%" + value + "%' and";
+                            con = " (" + field + " like '%" + value + "%') and";
                         } else if ("condition".equals(type)) {
                             //type为condition为前端拼的条件
-                            con = " " + value + " and";
+                            con = " (" + value + ") and";
                         } else {
-                            con = " " + field + " " + operation + " '" + value + "' and";
+                            con = " (" + field + " " + operation + " '" + value + "') and";
                         }
 
                     }

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

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

+ 10 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/HomePageController.java

@@ -104,4 +104,14 @@ public class HomePageController {
         return homePageService.keyData();
     }
 
+    /**
+     * @Description 本月毛利润
+     * @return: com.usoftchina.saas.base.Result
+     * @Author: guq
+     * @Date: 2018/12/10
+     */
+    @GetMapping("/monthProfit")
+    public Result monthProfit() {
+        return homePageService.monthProfit();
+    }
 }

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

@@ -19,4 +19,6 @@ public interface HomePageMapper {
     String getSaleFutureData(Long componyId);
 
     String getKeyData(Long companyId);
+
+    String monthProfit(Long companyId);
 }

+ 2 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/HomePageService.java

@@ -51,4 +51,6 @@ public interface HomePageService {
     Result saleFutureData();
 
     Result keyData();
+
+    Result monthProfit();
 }

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

@@ -86,6 +86,13 @@ public class HomePageServiceImpl implements HomePageService{
         return Result.success(data);
     }
 
+    @Override
+    public Result monthProfit() {
+        Long companyId = BaseContextHolder.getCompanyId();
+        Object data = parseJson(homePageMapper.monthProfit(companyId));
+        return Result.success(data);
+    }
+
     private Object parseJson(String text) {
         Object json = null;
         if (null != text) {

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

@@ -116,4 +116,36 @@
             )d1
             );
     </select>
+
+    <select id="monthProfit" parameterType="long" resultType="string">
+        select concat('[',five_profit,',',other_profit,']') from (
+      (
+        #前5数据
+        select group_concat('{"x":"',custname,'","y":',profit/10000,',"z":"',shortname,'"}') five_profit   from (
+        select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
+        pi_custcode,max(pi_custname) custname,max(ifnull(cu_shortname,'')) shortname  from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
+        where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId}
+        GROUP BY pi_custcode,prodinout.companyid order by profit desc  limit 0,4) t
+        )five_profit_,
+	  (
+	    #其它的数据
+		select concat('{"z":"其它","x":"其它","y":',(all_profit - five_profit)/10000,'}') other_profit from (
+        #总共
+        (
+        select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) all_profit
+        from prodinout left join prodiodetail on pi_id=pd_piid
+        where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId} )a1_,
+        #前5总和
+        (
+        select sum(profit) five_profit from (select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
+        pi_custcode,max(pi_custname) custname,prodinout.companyid from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
+         where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId}
+        GROUP BY pi_custcode,prodinout.companyid order by profit desc  limit 0,4) b)a2_
+       )
+       ) other_profit_
+      )
+    </select>
 </mapper>

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

@@ -524,8 +524,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                     customerDTO.setCu_sellercode(employees.get(0).getEm_code());
                     customerDTO.setCu_sellername(employees.get(0).getEm_name());
                 }
-                customerDTO.setCu_status(Status.OPEN.getDisplay());
-                customerDTO.setCu_statuscode(Status.OPEN.name());
+                customerDTO.setCu_status(Status.ENABLE.getDisplay());
+                customerDTO.setCu_statuscode(Status.ENABLE.name());
                 //编号不存在
                 if (i == 0) {
                     customerDTO.setId(0l);

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

@@ -30,6 +30,7 @@ import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -241,7 +242,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             String inoutCode = maxnumberService.getMaxnumber("StorageInit", true).getData();
             prodInOut.setPi_inoutno(inoutCode);     //出入库单号
             prodInOut.setPi_class("库存初始化");
-            prodInOut.setPi_date(new Date());
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            prodInOut.setPi_date(calendar.getTime());   //赋值为当月第一天
             //prodInOut.setPi_total();            //含税金额
             prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
             prodInOut.setPi_statuscode(Status.UNAUDITED.name());
@@ -584,8 +588,8 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                         break;
                     }
                     product.setPr_whid(warehouse.getId());
-                    product.setPr_status(Status.OPEN.getDisplay());
-                    product.setPr_statuscode(Status.OPEN.name());
+                    product.setPr_status(Status.ENABLE.getDisplay());
+                    product.setPr_statuscode(Status.ENABLE.name());
                 }
                 //编号不存在
                 if (i == 0) {

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

@@ -453,8 +453,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 List<DataImportDetail> data = datas.get(code);
                 DataImportDetail main = dataImportMapper.selectMainBycode(code, id, companyId);
                 Vendor vendor = JSONObject.parseObject(main.getDd_maindata(), Vendor.class);
-                vendor.setVe_status(Status.OPEN.getDisplay());
-                vendor.setVe_statuscode(Status.OPEN.name());
+                vendor.setVe_status(Status.ENABLE.getDisplay());
+                vendor.setVe_statuscode(Status.ENABLE.name());
                 //编号不存在
                 if (i == 0) {
                     vendor.setId(0l);

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

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

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java

@@ -38,7 +38,7 @@ public class PaybalanceController {
     }
 
     @Transactional
-    @PostMapping("/deleteDetail/{id}")
+    @PostMapping("/deleteDetail1/{id}")
     public Result deleteItem(@PathVariable("id") int id){
         paybalanceService.deleteItem(id);
         return Result.success();

+ 11 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ProfitdetailMapper.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Profitpresent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ProfitdetailMapper {
+    List<Profitpresent> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java

@@ -40,4 +40,6 @@ public interface VerificationMapper extends CommonBaseMapper<Verification> {
     String validateResAudit(@Param("id") Long id);
 
     int validateSetAcount(@Param("detno") int detno,@Param("companyid")Long companyid);
+
+    void updateAuditMsg (@Param("id") Long id,@Param("userName")String userName);
 }

+ 37 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java

@@ -21,6 +21,43 @@ public class Custmonth {
 
     private Integer companyid;
 
+    private Double cm_beginpreamount;
+    private Double cm_nowpayamount;
+    private Double cm_nowprepayamount;
+    private Double cm_endpreamount;
+
+    public Double getCm_beginpreamount() {
+        return cm_beginpreamount;
+    }
+
+    public void setCm_beginpreamount(Double cm_beginpreamount) {
+        this.cm_beginpreamount = cm_beginpreamount;
+    }
+
+    public Double getCm_nowpayamount() {
+        return cm_nowpayamount;
+    }
+
+    public void setCm_nowpayamount(Double cm_nowpayamount) {
+        this.cm_nowpayamount = cm_nowpayamount;
+    }
+
+    public Double getCm_nowprepayamount() {
+        return cm_nowprepayamount;
+    }
+
+    public void setCm_nowprepayamount(Double cm_nowprepayamount) {
+        this.cm_nowprepayamount = cm_nowprepayamount;
+    }
+
+    public Double getCm_endpreamount() {
+        return cm_endpreamount;
+    }
+
+    public void setCm_endpreamount(Double cm_endpreamount) {
+        this.cm_endpreamount = cm_endpreamount;
+    }
+
     public Integer getCm_id() {
         return cm_id;
     }

+ 109 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Profitpresent.java

@@ -0,0 +1,109 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+/**
+ * @author heqw
+ * @date 2018/12/10 10:45
+ **/
+public class Profitpresent {
+    private Date pi_date;
+    private Integer pi_ym;
+    private String pi_custcode;
+    private String pi_custname;
+    private String cu_sellername;
+    private Double saamount;
+    private Double netamount;
+    private Double costamount;
+    private Double profit;
+    private Double profitpresent;
+    private String cu_type;
+
+    public String getCu_type() {
+        return cu_type;
+    }
+
+    public void setCu_type(String cu_type) {
+        this.cu_type = cu_type;
+    }
+
+    public Date getPi_date() {
+        return pi_date;
+    }
+
+    public void setPi_date(Date pi_date) {
+        this.pi_date = pi_date;
+    }
+
+    public Integer getPi_ym() {
+        return pi_ym;
+    }
+
+    public void setPi_ym(Integer pi_ym) {
+        this.pi_ym = pi_ym;
+    }
+
+    public String getPi_custcode() {
+        return pi_custcode;
+    }
+
+    public void setPi_custcode(String pi_custcode) {
+        this.pi_custcode = pi_custcode;
+    }
+
+    public String getPi_custname() {
+        return pi_custname;
+    }
+
+    public void setPi_custname(String pi_custname) {
+        this.pi_custname = pi_custname;
+    }
+
+    public String getCu_sellername() {
+        return cu_sellername;
+    }
+
+    public void setCu_sellername(String cu_sellername) {
+        this.cu_sellername = cu_sellername;
+    }
+
+    public Double getSaamount() {
+        return saamount;
+    }
+
+    public void setSaamount(Double saamount) {
+        this.saamount = saamount;
+    }
+
+    public Double getNetamount() {
+        return netamount;
+    }
+
+    public void setNetamount(Double netamount) {
+        this.netamount = netamount;
+    }
+
+    public Double getCostamount() {
+        return costamount;
+    }
+
+    public void setCostamount(Double costamount) {
+        this.costamount = costamount;
+    }
+
+    public Double getProfit() {
+        return profit;
+    }
+
+    public void setProfit(Double profit) {
+        this.profit = profit;
+    }
+
+    public Double getProfitpresent() {
+        return profitpresent;
+    }
+
+    public void setProfitpresent(Double profitpresent) {
+        this.profitpresent = profitpresent;
+    }
+}

+ 36 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java

@@ -20,6 +20,42 @@ public class Vendmonth {
     private Double vm_endamount;
 
     private Integer companyid;
+    private Double vm_beginpreamount;
+    private Double vm_nowpayamount;
+    private Double vm_nowprepayamount;
+    private Double vm_endpreamount;
+
+    public Double getVm_beginpreamount() {
+        return vm_beginpreamount;
+    }
+
+    public void setVm_beginpreamount(Double vm_beginpreamount) {
+        this.vm_beginpreamount = vm_beginpreamount;
+    }
+
+    public Double getVm_nowpayamount() {
+        return vm_nowpayamount;
+    }
+
+    public void setVm_nowpayamount(Double vm_nowpayamount) {
+        this.vm_nowpayamount = vm_nowpayamount;
+    }
+
+    public Double getVm_nowprepayamount() {
+        return vm_nowprepayamount;
+    }
+
+    public void setVm_nowprepayamount(Double vm_nowprepayamount) {
+        this.vm_nowprepayamount = vm_nowprepayamount;
+    }
+
+    public Double getVm_endpreamount() {
+        return vm_endpreamount;
+    }
+
+    public void setVm_endpreamount(Double vm_endpreamount) {
+        this.vm_endpreamount = vm_endpreamount;
+    }
 
     public Integer getVm_id() {
         return vm_id;

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

@@ -43,6 +43,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     private CustmonthMapper custmonthMapper;
     @Autowired
     private BanksubledgerMapper banksubledgerMapper;
+    @Autowired
+    private ProfitdetailMapper profitdetailMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -278,6 +280,11 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
                 res = banksubledgerMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
+        }else if("profitdetails".equals(type)){
+            list = profitdetailMapper.selectByCondition(con, companyId);
+            if (!StringUtils.isEmpty(calculateFieldsSql)) {
+                res = profitdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+            }
         }
 
         try {

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

@@ -226,8 +226,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     throw new BizException(code, error);
                 }
                 if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
-                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
-                    int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
+                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getMessage();
+                    int code = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getCode();
                     String error = String.format(msg, det.getVd_slkind());
                     throw new BizException(code, error);
                 }
@@ -247,8 +247,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     throw new BizException(code, error);
                 }
                 if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
-                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
-                    int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
+                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getMessage();
+                    int code = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getCode();
                     String error = String.format(msg, detail.getVcd_slkind());
                     throw new BizException(code, error);
                 }
@@ -274,16 +274,25 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         String kind = verification.getVc_kind();
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(verification.getVc_code());
-        kind = transferKind(kind);
-        subledger.setSl_kind(kind);
+
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ||
                 kind.equals("receivable_offset_payable")){
+
+            /*
+             ['receipts_offset_receivable', '预收冲应收'],
+                ['prepaid_offset_payable', '预付冲应付'],
+                ['receivable_offset_payable', '应收冲应付'],
+                ['receivable_to_receivable', '应收转应收'],
+                ['payable_to_payable', '应付转应付']
+             */
             subledger.setSl_custid(0);
             subledger.setSl_vendid(verification.getVc_vendid());
         }else{
             subledger.setSl_custid(verification.getVc_custid());
             subledger.setSl_vendid(0);
         }
+        kind = transferKind(kind);
+        subledger.setSl_kind(kind);
         Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
         Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
         subledger.setSl_date(verification.getVc_date());
@@ -521,9 +530,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     @Override
     public void deleteDetail2(Long id) {
         if (null != id) {
-            verificationdetailMapper.deleteByParentPrimaryKey(id);
             Verificationdetail verificationdetail = verificationdetailMapper.selectByPrimaryKey(Integer.valueOf(String.valueOf(id)));
-            Verification verification = verificationMapper.selectByPrimaryKey(verificationdetail.getVcd_vcid());
+            Verification verification = verificationMapper.selectByPrimaryKey(verificationdetail.getVcd_vcid().intValue());
+            verificationdetailMapper.deleteByParentPrimaryKey(id);
             DocBaseDTO baseDTO = new DocBaseDTO();
             baseDTO.setId(id);
             baseDTO.setCode(verification.getVc_code());
@@ -543,8 +552,6 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         formData.getMain().setVc_auditdate(new Date());
         baseDTO = this.saveFormData(formData);
         Long id = baseDTO.getId();
-
-
             VerificationDTO verificationDTO = formData.getMain();
             Subledger subledger = changSubledgerUntil(verificationDTO);
             subledgerMapper.insertSelective(subledger);
@@ -573,7 +580,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
         //更新出入库状态
         this.updateProdInoutStatus(id);
-
+        //更新审核人和审核日期
+        verificationMapper.updateAuditMsg(id,BaseContextHolder.getUserName());
         baseDTO.setId(id);
         baseDTO.setName(BillCodeSeq.VERIFICATION.getCaller());
         baseDTO.setCode(formData.getMain().getVc_code());

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

@@ -12,10 +12,14 @@
     <result column="cm_nowpreamount" property="cm_nowpreamount" jdbcType="DOUBLE" />
     <result column="cm_endamount" property="cm_endamount" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="cm_beginpreamount" property="cm_beginpreamount" jdbcType="DOUBLE" />
+    <result column="cm_nowpayamount" property="cm_nowpayamount" jdbcType="DOUBLE" />
+    <result column="cm_nowprepayamount" property="cm_nowprepayamount" jdbcType="DOUBLE" />
+    <result column="cm_endpreamount" property="cm_endpreamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     cm_id, cm_yearmonth, cm_custid, cm_custcode, cm_custname, CM_BEGINAMOUNT, CM_NOWAMOUNT, 
-    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid
+    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid,cm_endpreamount,cm_nowprepayamount,cm_nowpayamount,cm_beginpreamount
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

+ 136 - 0
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -0,0 +1,136 @@
+<?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.ProfitdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Profitpresent" >
+    <result column="pi_ym" property="pi_ym" jdbcType="INTEGER" />
+    <result column="pi_custcode" property="pi_custcode" jdbcType="VARCHAR" />
+    <result column="pi_custname" property="pi_custname" jdbcType="VARCHAR" />
+	  <result column="cu_type" property="cu_type" jdbcType="VARCHAR" />
+    <result column="cu_sellername" property="cu_sellername" jdbcType="VARCHAR" />
+    <result column="saamount" property="saamount" jdbcType="DOUBLE" />
+    <result column="netamount" property="netamount" jdbcType="DOUBLE" />
+    <result column="costamount" property="costamount" jdbcType="DOUBLE" />
+    <result column="profit" property="profit" jdbcType="DOUBLE" />
+    <result column="profitpresent" property="profitpresent" jdbcType="DOUBLE" />
+    <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    cu_type, pi_custcode, pi_custname, cu_sellername, saamount, netamount, costamount, profit,
+    profitpresent
+  </sql>
+
+  <select id="selectByCondition" parameterType="java.lang.Long" resultMap="BaseResultMap">
+   SELECT
+	a.pi_custcode,
+	a.pi_custname,
+	a.cu_type,
+	a.cu_sellername,
+	a.saamount,
+	a.netamount,
+	a.costamount,
+SUM(a.netamount - a.costamount) as profit,
+(SUM(a.netamount - a.costamount)/IFNULL(netamount,SUM(netamount - costamount))) as profitpresent
+
+FROM
+	(
+		SELECT
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername,
+			SUM(
+				pd_sendprice * (pd_outqty - pd_inqty)
+			) AS saamount,
+			SUM(
+				pd_netprice * (pd_outqty - pd_inqty)
+			) AS netamount,
+			SUM(
+				pd_price * (pd_outqty - pd_inqty)
+			) AS costamount
+		FROM
+			prodinout,
+			prodiodetail,
+			customer
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyid = #{companyId}
+      </if>
+    </where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and pi_status = '已审核' and
+prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		GROUP BY
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername
+	) a GROUP BY
+			a.pi_custcode,
+			a.pi_custname,
+	        a.cu_type,
+			a.cu_sellername
+	  ORDER BY a.pi_custname asc,a.pi_custname desc
+  </select>
+
+	<select id="selectCalculateFields" resultType="string">
+		SELECT ${fields}
+		FROM
+		(
+		SELECT
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername,
+		a.saamount,
+		a.netamount,
+		a.costamount,
+		SUM(a.netamount - a.costamount) as profit,
+		(SUM(a.netamount - a.costamount)/IFNULL(netamount,SUM(netamount - costamount))) as profitpresent
+
+		FROM
+		(
+		SELECT
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername,
+		SUM(
+		pd_sendprice * (pd_outqty - pd_inqty)
+		) AS saamount,
+		SUM(
+		pd_netprice * (pd_outqty - pd_inqty)
+		) AS netamount,
+		SUM(
+		pd_price * (pd_outqty - pd_inqty)
+		) AS costamount
+		FROM
+		prodinout,
+		prodiodetail,
+		customer
+		<where>
+			<if test="con != null">
+				${con}
+			</if>
+			<if test="companyId != null">
+				and  prodinout.companyid = #{companyId}
+			</if>
+		</where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and pi_status = '已审核' and
+		prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		GROUP BY
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername
+		) a GROUP BY
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername)b
+	</select>
+
+</mapper>

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

@@ -12,10 +12,14 @@
     <result column="vm_nowpreamount" property="vm_nowpreamount" jdbcType="DOUBLE" />
     <result column="vm_endamount" property="vm_endamount" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="vm_beginpreamount" property="vm_beginpreamount" jdbcType="DOUBLE" />
+    <result column="vm_nowpayamount" property="vm_nowpayamount" jdbcType="DOUBLE" />
+    <result column="vm_nowprepayamount" property="vm_nowprepayamount" jdbcType="DOUBLE" />
+    <result column="vm_endpreamount" property="vm_endpreamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     vm_id, vm_yearmonth, vm_vendid, VM_VENDCODE, VM_VENDNAME, VM_BEGINAMOUNT, VM_NOWAMOUNT, 
-    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid
+    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid,vm_endpreamount,vm_nowprepayamount,vm_nowpayamount,vm_beginpreamount
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

+ 3 - 3
applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml

@@ -619,7 +619,7 @@
     select count(1) from periodsdetail where pd_detno = #{detno} and IFNULL(pd_status,0)=99
     and companyid= #{companyid}
   </select>
-  <select id="checkStatus" resultType="int">
-    select count(1) from Verification where ifnull(vc_statuscode,'')='AUDITED' and vc_id= #{id,jdbcType=INTEGER}
-  </select>
+  <update id="updateAuditMsg">
+    update verification set vc_auditman  = #{userName},vc_auditdate = NOW() where vc_id = #{id}
+  </update>
 </mapper>

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

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

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

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

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

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

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -65,6 +65,8 @@ public class SaleList implements Serializable {
 
     private String sa_auditman;
 
+    private String sa_seller;
+
     private Integer sa_sellerid;
 
     private Integer sd_id;

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java

@@ -58,4 +58,6 @@ public class SaleProfitView {
     private Double pd_profitpresent;
 
     private Double pw_costprice;
+
+    private Date pi_date;
 }

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

@@ -464,7 +464,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
-        targetPi.setCreatorId(BaseContextHolder.getUserId());
+
         targetPi.setPi_ioid(id);
         targetPi.setPi_inoutno(piInoutno);
         targetPi.setPi_class(BillCodeSeq.SALEIN.getName());
@@ -488,6 +488,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         getMapper().insertSelective(targetPi);
         //插入销售退货单从表
         long pi_id = targetPi.getId();
+        getMapper().updateCreator(BaseContextHolder.getUserId(), BaseContextHolder.getUserName(),pi_id);
         for (int i = 0;i<sourceDetails.size();i++){
             ProdIODetail sourcePid = sourceDetails.get(i);
             ProdIODetail targetPid = new ProdIODetail();

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

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

+ 3 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -28,6 +28,7 @@
         <result column="sa_text3" property="sa_text3" jdbcType="VARCHAR" />
         <result column="sa_text4" property="sa_text4" jdbcType="VARCHAR" />
         <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
+        <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
         <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
         <result column="sd_id" property="sd_id" jdbcType="INTEGER" />
         <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
@@ -81,8 +82,9 @@
         select  *  from sale left join saledetail on sa_id=sd_said left join product
         on sd_prodid = pr_id and sale.companyId = product.companyid
         <where>
+            sa_statuscode='AUDITED'
             <if test="con != null">
-                ${con}
+               and  ${con}
             </if>
             <if test="companyId != null">
                 and   sale.companyId = #{companyId}

+ 2 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml

@@ -7,6 +7,7 @@
     <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
     <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
     <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP" />
+    <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
     <result column="pd_inoutno" property="pd_inoutno" jdbcType="VARCHAR" />
     <result column="pd_piclass" property="pd_piclass" jdbcType="VARCHAR" />
     <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
@@ -37,7 +38,7 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by sa_date desc
+    order by pi_date desc
   </select>
 
   <select id="selectCalculateFields" resultType="string">

+ 1 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java

@@ -30,5 +30,6 @@ public class ProdiodetailView implements Serializable{
     private String pd_remark;
     private Integer companyid;
 
+    private String pd_whname;
 
 }

+ 4 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java

@@ -103,6 +103,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
             prodIn.setPi_status("未审核");
             prodIn.setPi_statuscode("UNAUDITED");
             prodIn.setCompanyId(companyId);
+            prodIn.setCreateTime(new Date());
             prodIn.setPi_remark("盘盈单");
             prodInOutMapper.insertSelective(prodIn);
             long inid = prodIn.getId();
@@ -128,6 +129,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodInDetail.setCompanyId(companyId);
                 prodInDetail.setCreateTime(new Date());
                 prodInDetail.setCreatorId(userId);
+                prodInDetail.setCreatorName(userName);
                 prodInDetail.setPd_remark("盘盈单");
                 prodIODetailMapper.insertSelective(prodInDetail);
             }
@@ -147,6 +149,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
             prodOut.setPi_statuscode("UNAUDITED");
             prodOut.setCompanyId(companyId);
             prodOut.setPi_remark("盘亏单");
+            prodOut.setCreateTime(new Date());
             prodInOutMapper.insertSelective(prodOut);
             long outid = prodOut.getId();
             //更新录入人
@@ -168,6 +171,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodOutDetail.setCompanyId(companyId);
                 prodOutDetail.setCreateTime(new Date());
                 prodOutDetail.setCreatorId(userId);
+                prodOutDetail.setCreatorName(userName);
                 prodOutDetail.setPd_remark("盘亏单");
                 prodIODetailMapper.insertSelective(prodOutDetail);
             }

+ 18 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -219,6 +219,15 @@
       <if test="pd_ioid != null">
         pd_ioid,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="pd_piid != null">
@@ -338,6 +347,15 @@
       <if test="pd_ioid != null">
         #{pd_ioid,jdbcType=INTEGER},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null">
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP}
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml

@@ -20,6 +20,7 @@
     <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
     <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
     <result column="companyid" jdbcType="INTEGER" property="companyid" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
   </resultMap>
 
 
@@ -55,7 +56,6 @@
         and  companyid = #{companyId}
       </if>
     </where>
-    order by pi_date desc
   </select>
 
 

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

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

+ 1 - 1
base-servers/account/account-server/src/main/resources/application.yml

@@ -83,7 +83,7 @@ auth:
   public-key: auth/pub.key
 sso:
 #  base-url: https://sso.ubtob.com
-  base-url: https://tsso.usoftchina.com/
+  base-url: https://test-sso.uuzcc.cn
 ribbon:
   ReadTimeout: 6000
   ConnectTimeout: 2000

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

@@ -231,7 +231,7 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    ServletUtils.writeJsonPMessage(response, callback, false);
+                    //ServletUtils.writeJsonPMessage(response, callback, false);
                     return "successCallback({success:'0'})";
                 }
             } else {
@@ -242,7 +242,7 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        ServletUtils.writeJsonPMessage(response, callback, false);
+                        //ServletUtils.writeJsonPMessage(response, callback, false);
                         return "successCallback({success:'0'})";
                     }
                 }
@@ -265,7 +265,7 @@ public class AuthController {
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
             }
-            ServletUtils.writeJsonPMessage(response, callback, true);
+            //ServletUtils.writeJsonPMessage(response, callback, true);
             return "successCallback({success:'1'})";
         }
         return "successCallback({success:'0'})";

+ 1 - 1
base-servers/auth/sso-api/src/test/resources/application.yml

@@ -1,3 +1,3 @@
 sso:
-  base-url: https://tsso.usoftchina.com
+  base-url: https://test-sso.uuzcc.cn
 #  base-url: https://sso.ubtob.com

+ 19 - 0
base-servers/sms/sms-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,19 @@
+eureka:
+  instance:
+    hostname: saas-sms-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 1 - 1
frontend/saas-portal-web/config/dev.env.js

@@ -10,6 +10,6 @@ module.exports = merge(prodEnv, {
     // 后端接口网关
     api: '"https://saas-api-dev.usoftchina.com:5443"',
     // 账户中心接口
-    sso: '"https://tsso.usoftchina.com"'
+    sso: '"https://test-sso.uuzcc.cn"'
   }
 })

+ 1 - 1
frontend/saas-portal-web/config/test.env.js

@@ -10,6 +10,6 @@ module.exports = merge(devEnv, {
     // 后端接口网关
     api: '"https://saas-api-test.usoftchina.com:5443"',
     // 账户中心接口
-    sso: '"https://tsso.usoftchina.com"'
+    sso: '"https://test-sso.uuzcc.cn"'
   }
 })

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

@@ -19,12 +19,12 @@
                 <ul id="nav" class="nav navbar-nav menu">
                     <li><router-link to="/home"><a href="#"><span style="color: white">首页</span></a></router-link></li>
                     <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
-                    <li style="margin-left:30px">
+                    <li style="margin-left:30px;    margin-top: 13px;    cursor: pointer;">
                         <span style="color:#fff;font-size: 16px;">
                             <img style="width: 20px;" src="/static/img/assets/denglu3x.png" alt="">
                             {{mytoken.realname}}
                         </span>
-                        <a href=""><span @click="loginout">【退出】</span></a>
+                        <span style="color:#fff;" @click="loginout">【退出】</span>
                     </li>
                 </ul>
             </div>

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

@@ -491,4 +491,69 @@ div::-webkit-scrollbar-track {
   & > div > div > div.x-box-inner.x-box-scroller-body-vertical.x-scroller > div > div > a > span {
     margin-left: 28px;
   }
+}
+
+/** responsivecolumn **/
+.x-responsivecolumn {
+  padding: 0;
+
+  & > * {
+      margin: 0;
+
+  }
+}
+
+// @mixin responsivecolumn-item($width: 100%) {
+//   width: #{$width};
+// }
+
+.big-100 {
+  // width: 100%;
+  @include responsivecolumn-item(100%);
+}
+
+.big-60 {
+  // width: 60%;
+  @include responsivecolumn-item(60%);
+}
+
+.big-50 {
+  float: left;
+  // width: 50%;
+  @include responsivecolumn-item(50%);
+}
+
+.big-40 {
+  float: left;
+  // width: 40%;
+  @include responsivecolumn-item(40%);
+}
+
+.big-33 {
+  float: left;
+  // width: 33.33%;
+  @include responsivecolumn-item(33.33%);
+}
+
+.big-20 {
+  float: left;
+  // width: 20%;
+  @include responsivecolumn-item(20%);
+}
+
+//--------------------------------------------------------
+// And classes for small-size responsive items
+
+.x-responsivecolumn-small {
+   > .small-100 {
+      float: left;
+      // width: 100%;
+      @include responsivecolumn-item(100%);
+   }
+
+   > .small-50 {
+      float: left;
+      // width: 50%;
+      @include responsivecolumn-item(50%);
+   }
 }

+ 34 - 8
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -190,9 +190,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     listeners: {
         blur:function(f,e){
             var me = f;
-            var count = f.store.getCount();
-            var searchCount = false;//校验数据库是否有该字段
-            var dbfinds = me.dbfinds;
+            var dbfinds = me.dbfinds,data;
             if(f.value&&f.value!=''){
                 //添加默认条件
                 var searchField = null;
@@ -211,7 +209,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 }
                 dbCondition.push({
                     type: 'condition',
-                    value: searchField + "='"+me.value+"'"
+                    value: searchField + " like '%"+me.value+"%'"
                 });
                 Ext.Ajax.request({
                     url: me.dataUrl,
@@ -228,14 +226,11 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = data.data?data.data.list:[];
-                        if(data.length>0){
-                            searchCount = true
-                        }
                     },
                     failure: function(response, opts) {}
                 }); 
             }
-            if(!f.value||f.value==''||!searchCount){
+            if(!f.value||f.value==''||data.length>1||data.length==0){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
@@ -269,6 +264,37 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                         }
                     }
                 }
+            }else if(data.length==1){
+                var dbfinds = me.dbfinds;
+                if(dbfinds&&dbfinds.length>0){
+                    if(me.belong=='grid'){
+                        for (let index = 0; index < dbfinds.length; index++) {
+                            var item = dbfinds[index];
+                            var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
+                            var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+                            nowRec.set(item.to,data[0][item.from]);
+                            if(me.name==item.to){
+                                me.column.getEditor().setValue(data[0][item.from]);
+                            }
+                        }
+                    }else if(me.belong=='form'){
+                        for (let index = 0; index < dbfinds.length; index++) {
+                            var item = dbfinds[index];
+                            var field = me.ownerCt.down('[name='+item.to+']');
+                            if(field){
+                                var val = data[0][item.from];
+                                if(field.xtype=='dbfindtrigger'){
+                                    field.setRawValue(val);
+                                    field.setValue(val);
+                                    field.value = val;
+                                    field.lastTriggerValue=val;
+                                }else{
+                                    field.setValue(val);
+                                }    
+                            }
+                        }
+                    }
+                }
             }
         },
         select:function(combo,record,eOpts){

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

@@ -172,9 +172,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
 
     listeners: {
         blur:function(f,e){
-            var me = f;
-            var count = f.store.getCount();
-            var searchCount = false;//校验数据库是否有该字段
+            var me = f,data;
             var dbfinds = me.dbfinds;
             if(f.value&&f.value!=''){
                 //添加默认条件
@@ -194,7 +192,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                 }
                 dbCondition.push({
                     type: 'condition',
-                    value: searchField + "='"+me.value+"'"
+                    value: searchField + " like '%"+me.value+"%'"
                 });
                 Ext.Ajax.request({
                     url: me.dataUrl,
@@ -211,14 +209,11 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = data.data?data.data.list:[];
-                        if(data.length>0){
-                            searchCount = true
-                        }
                     },
                     failure: function(response, opts) {}
                 }); 
             }
-            if(!f.value||f.value==''||!searchCount){
+            if(!f.value||f.value==''||data.length>1||data.length==0){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
@@ -238,17 +233,18 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                                 me.column.getEditor().setValue('');
                             }
                         }
-                    }else if(me.belong=='form'){
+                    }
+                }
+            }else if(data.length==1){
+                if(dbfinds&&dbfinds.length>0){
+                    if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
                             var item = dbfinds[index];
-                            var field = me.ownerCt.down('[name='+item.to+']');
-                            if(field){
-                                if(field.xtype=='dbfindtrigger'){
-                                    field.setValue(null);
-                                    field.lastTriggerValue=null;
-                                }else{
-                                    field.setValue(null);
-                                }    
+                            var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
+                            var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+                            nowRec.set(item.to,data[0][item.from]);
+                            if(me.name==item.to){
+                                me.column.getEditor().setValue(data[0][item.from]);
                             }
                         }
                     }

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

@@ -190,8 +190,8 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             to.setValue(null);
             me.firstVal = null;
             me.secondVal = null;
-            from.setEditable(true);
-            to.setEditable(true);
+            //from.setEditable(true);
+            //to.setEditable(true);
         } else {
             from.setValue(minDate);
             to.setValue(maxDate);

+ 7 - 0
frontend/saas-web/app/view/core/form/field/ConMonthField.scss

@@ -0,0 +1,7 @@
+.x-conmonthfield > div > div > div > div > div:nth-child(1) > div > div {
+    border-right: none;
+    border-radius: 4px 0 0 4px;
+}
+.x-conmonthfield > div > div > div > div > div:nth-child(2) > div > div {
+    border-radius: 0 4px 4px 0;
+}

+ 3 - 0
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -234,6 +234,8 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             }
         });
 
+        // 不写该方法合计列会错位,这里触发afterEdit事件用来刷新grid
+        store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
         me.fireEvent('validChange');
         return r;
     },
@@ -282,6 +284,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             store.remove(selectedRecord);
             me.fireEvent('validChange');
         }
+        // 不写该方法合计列会错位,这里触发afterEdit事件用来刷新grid
         store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
     },
 

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

@@ -20,80 +20,127 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
         labelWidth: 90,
         columnWidth: 0.25,
         blankText: '该字段不能为空',
-	},
-
-    dockedItems: [{
-        width:140,
-        height: 70,
-        xtype: 'toolbar',
-        dock: 'right',
-        items: [{
-            margin:'8 0 0 0',
-            xtype: 'buttongroup',
-            cls:'x-query-buttongroup',
-            items:[{
-                height:32,
-                width:70,
-                style:'min-width: 0px;min-height: 0px;',
-                xtype: 'button',
-                name:'query',
-                text: '查询',
-                handler: 'onQuery',
-            },{
-                style:'min-width: 0px;min-height: 0px;border-color: #fff;background-color: #fff;padding: 0px;margin-top: -1px;margin-left: -2px;',
-                xtype: 'button',
-                iconCls:'x-btn-show',
-                handler: 'showMore',
-                name:'showMore',
-                tooltip:'更多',
-                listeners:{
-                    afterrender:function(b){
-                        var count = window.innerHeight - 110>=800?2:1;
-                        var columnWidthCount = 0;
-                        var items = b.ownerCt.ownerCt.ownerCt.items.items;
-                        Ext.each(items, function(item, index){
-                            if(item.xtype != 'hidden'){
-                                columnWidthCount+= item.columnWidth
-                            }
-                        });
-                        columnWidthCount = Math.ceil(columnWidthCount);
-                        if(columnWidthCount<=count){
-                            b.hide();
-                        }
-                    }
-                }
-            },{
-                name:'hideMore',
-                hidden:true,
-                tooltip:'隐藏',
-                style:'min-width: 0px;min-height: 0px;border-color: #fff;background-color: #fff;padding: 0px;margin-top: -1px;margin-left: -2px;',
-                xtype: 'button',
-                iconCls:'x-btn-hide',
-                handler: 'hideMore'
-            }]
-        },'->']
-    }],
+    },
+    
+    toggleConfig: {
+        showMoreIconCls: 'x-btn-show',
+        shwoMoreTooltip: '更多',
+        hideMoreIconCls: 'x-btn-hide',
+        hideMoreTooltip: '隐藏'
+    },
+
+    initComponent: function() {
+        var me = this,
+        config = me.toggleConfig;
+        
+        Ext.apply(me, {
+            dockedItems: [{
+                width:140,
+                height: 70,
+                xtype: 'toolbar',
+                dock: 'right',
+                items: [{
+                    margin:'8 0 0 0',
+                    xtype: 'buttongroup',
+                    cls:'x-query-buttongroup',
+                    items:[{
+                        height:32,
+                        width:70,
+                        style:'min-width: 0px;min-height: 0px;',
+                        xtype: 'button',
+                        name:'query',
+                        text: '查询',
+                        handler: 'onQuery',
+                    },{
+                        style:'min-width: 0px;min-height: 0px;border-color: #fff;background-color: #fff;padding: 0px;margin-top: -1px;margin-left: -2px;',
+                        xtype: 'button',
+                        handler: function(b) {
+                            var form = b.up('core-query-queryformpanel');
+                            form.toggleShowMore();
+                        },
+                        name:'toggle',
+                        iconCls: config.hideMoreIconCls,
+                        tooltip: config.hideMoreTooltip,
+                    }]
+                },'->']
+            }],
+        });
+
+        me.callParent(arguments);
+    },
 
     listeners: {
-        boxReady:function(form){
+        boxready:function(form){
             if(window.innerHeight - 110 >= 800){
-                form.setHeight(96);
+                form.setFormItemRows(null, true);
+            }else {
+                form.setFormItemRows(1, true);
             }
         },
         beforerender: function(form) {
-            var fiels = form.getForm().getFields();
-            fiels.each(function(f) {
-                f.enableKeyEvents = true;
-                f.on && f.on({
-                    keydown: {
-                        fn: function(th, e, eOpts) {
-                            if(e.keyCode == 13) {
-                                form.up('core-query-querypanel').getController().onQuery()
-                            }
+            form.addItemEvenListeners();
+        }
+    },
+
+    addItemEvenListeners: function() {
+        var me = this,
+        queryPanel = me.up('core-query-querypanel'),
+        fiels = me.getForm().getFields();
+
+        fiels.each(function(f) {
+            f.enableKeyEvents = true;
+            f.on && f.on({
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            queryPanel.getController().onQuery()
                         }
                     }
-                });
+                }
             });
+        });
+    },
+
+    toggleShowMore: function(unanimate) {
+        var me = this,
+        showMore = typeof me.showMore != undefined ? !me.showMore : true,
+        rowItems = me.rowItems,
+        allRows = rowItems.length,
+        rows = showMore ? allRows : 1;
+
+        me.setFormItemRows(rows, unanimate);
+
+        var b = me.dockedItems.items[0].down('[name=query]');
+        b.removeFocusCls();
+        me.updateLayout();
+    },
+
+    setFormItemRows: function(rows, unanimate) {
+        var me = this,
+        rowItems = me.rowItems,
+        allRows = rowItems.length,
+        rows = rows ? rows : allRows,
+        showMore = rows == allRows;
+
+        var n_height = 14 + rows * ( 32 + 10 );
+
+        unanimate ? me.setHeight(n_height) : me.animate({dynamic: true, duration: 500, to: {height: n_height + 'px'}});
+        me.setToggleBtn(showMore);
+        me.showMore = showMore;
+        return rows;
+    },
+
+    setToggleBtn: function(showMore) {
+        var me = this,
+        config = me.toggleConfig,
+        toggleBtn = me.dockedItems.items[0].down('[name=toggle]');
+        
+        if(showMore) {
+            toggleBtn.setIconCls(config.hideMoreIconCls);
+            toggleBtn.setTooltip(config.hideMoreTooltip);
+        }else {
+            toggleBtn.setIconCls(config.showMoreIconCls);
+            toggleBtn.setTooltip(config.shwoMoreTooltip);
         }
     }
 

+ 115 - 97
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -16,7 +16,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
         reference: 'queryform',
         xtype: 'core-query-queryformpanel',
         width: '100%',
-        height:54,
         margin: '0 0 12 0',
     }, {
         // margin: '12 0 0 0',
@@ -55,14 +54,43 @@ Ext.define('saas.view.core.query.QueryPanel', {
         var me = this,
         items = me.queryFormItems,
         queryForm = me.getQueryForm(),
-        viewModel = me.getViewModel();
+        viewModel = me.getViewModel(),
+        rowItems = [], // 所有行*[[item], ...]
+        t_rowItems = [], // 当前行*[item, ...]
+        t_columnWidth = 0; // 当前行列宽之和
+
+        Ext.Array.each(items, function(item, index) {
+            item.columnWidth = item.columnWidth || 0.25;
 
-        Ext.Array.each(items, function(item) {
             var bind = item.bind,
+            columnWidth = item.columnWidth,
             name = item.name,
             ignore = item.ignore,
             defaultValue = item.defaultValue;
 
+            t_columnWidth += columnWidth;
+
+            if(t_columnWidth > 1) { // 当前行已放不下
+                // 先把上一行放入rowItems,当前行+1,再添加到当前行
+                rowItems.push(Ext.Array.clone(t_rowItems));
+                t_columnWidth = 0;
+                t_rowItems.length = 0;
+                t_rowItems.push(item);
+            }else if(t_columnWidth == 1) { // 刚好放满当前行
+                // 先添加到当前行并放入rowItems,当前行+1
+                t_rowItems.push(item);
+                rowItems.push(Ext.Array.clone(t_rowItems));
+                t_columnWidth = 0;
+                t_rowItems.length = 0;
+            }else { // 当前行未满
+                // 直接放入当前行
+                t_rowItems.push(item); // 添加到当前行
+
+                if(index == items.length - 1) { // 最后一个元素
+                    rowItems.push(Ext.Array.clone(t_rowItems));
+                }
+            }
+
             if(item.xtype == 'numberfield') {
                 Ext.applyIf(item, {
                     hideTrigger: true, // 隐藏trigger
@@ -92,6 +120,8 @@ Ext.define('saas.view.core.query.QueryPanel', {
             }
         });
 
+        queryForm.rowItems = rowItems;
+        queryForm.rows = rowItems.length;
         queryForm.items = items;
     },
 
@@ -116,120 +146,99 @@ Ext.define('saas.view.core.query.QueryPanel', {
     /**
      * 获得过滤条件
      */
-    getConditions: function(moreQuery) {
+    getConditions: function() {
         var me = this,
-        formItems = me.queryFormItems,
-        moreQueryFormItems = me.moreQueryFormItems,
+        formItems = me.items.items[0].items.items,
         viewModel = me.getViewModel(),
         viewModelData = viewModel.getData(),
         bindItems = viewModelData['form'],
-        moreItems = viewModelData['moreForm'],
         condition,
         conditions = [];
 
-        if(moreQuery) {
-            for(k in moreItems) {
-                var item = Ext.Array.findBy(moreQueryFormItems, function(i) {
-                    return i.name == k;
-                });
-                var field = item.name,
-                func = item.getCondition,
-                value = moreItems[k],
-                condition;
-    
-                if(value&&value!=''){
-                    if(typeof func == 'function') {
-                        condition = {
-                            type: 'condition',
-                            value: func(value)
-                        }
-                    }else {
-                        var xtype = item.xtype || 'textfield',
-                        type = item.fieldType || me.getDefaultFieldType(xtype),
-                        operation = item.operation || me.getDefaultFieldOperation(xtype),
-                        conditionValue = me.getConditionValue(xtype, value);
-            
-                        if(!conditionValue) {
-                            continue;
-                        }
-                        condition = {
-                            type: type,
-                            field: field,
-                            operation: operation,
-                            value: conditionValue
-                        }
+        for(k in bindItems) {
+            var item = Ext.Array.findBy(formItems, function(i) {
+                return i.name == k;
+            });
+            var field = item.name,
+            func = item.getCondition,
+            value = bindItems[k],
+            condition;
+
+            if(value&&value!=''){
+                if(typeof func == 'function') {
+                    condition = {
+                        type: 'condition',
+                        value: func(value)
                     }
-                    conditions.push(condition);
-                }
-            }
-        }else {
-            for(k in bindItems) {
-                var item = Ext.Array.findBy(formItems, function(i) {
-                    return i.name == k;
-                });
-                var field = item.name,
-                func = item.getCondition,
-                value = bindItems[k],
-                condition;
-    
-                if(value&&value!=''){
-                    if(typeof func == 'function') {
-                        condition = {
-                            type: 'condition',
-                            value: func(value)
-                        }
-                    }else {
-                        var xtype = item.xtype || 'textfield',
-                        type = item.fieldType || me.getDefaultFieldType(xtype),
-                        operation = item.operation || me.getDefaultFieldOperation(xtype),
-                        conditionValue = me.getConditionValue(xtype, value);
-            
-                        if(!conditionValue) {
-                            continue;
-                        }
-                        condition = {
-                            type: type,
-                            field: field,
-                            operation: operation,
-                            value: conditionValue
-                        }
+                }else {
+                    var type = item.fieldType || me.getDefaultFieldType(item),
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+        
+                    if(!conditionValue) {
+                        continue;
+                    }
+                    condition = {
+                        type: type,
+                        field: field,
+                        operation: operation,
+                        value: conditionValue
                     }
-                    conditions.push(condition);
                 }
+                conditions.push(condition);
             }
         }
 
         return conditions;
     },
 
-    getDefaultFieldType: function(xtype) {
-        var type;
+    /**
+     * 只要arr1和arr2中存在相同项即返回真
+     */
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
+            var a2 = arr2[i];
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    getDefaultFieldType: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            type;
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            type = 'enum';
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
-        }else {
+        } else {
             type = 'string';
         }
 
         return type;
     },
 
-    getDefaultFieldOperation: function(xtype) {
-        var operation;
+    getDefaultFieldOperation: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            operation;
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['datefield'], xtype)) {
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
-        }else {
+        } else {
             operation = 'like';
         }
 
@@ -239,22 +248,31 @@ Ext.define('saas.view.core.query.QueryPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(xtype, value) {
-        var conditionValue;
-        if(xtype == 'datefield') {
+    getConditionValue: function (field, value) {
+        var me = this,
+            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(xtype == 'condatefield') {
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } 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(xtype == 'combobox' || xtype == 'combo') {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(xtype == 'multicombo') {
-            conditionValue = value.map(function(v) {
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
                 return '\'' + v.value + '\'';
-            }).join(',');
-        }else {
+            }).join(',') : '';
+        } else {
             conditionValue = value;
         }
 

+ 0 - 34
frontend/saas-web/app/view/core/query/QueryPanelController.js

@@ -22,40 +22,6 @@ Ext.define('saas.view.core.query.QueryPanelController', {
         viewModel.set('moreQuery', false);
         queryGrid.store.loadPage(1);
     },
-    showMore:function (){
-        var me = this,
-        queryPanel = me.getView(),
-        queryForm = queryPanel.down('core-query-queryformpanel');
-        var items = queryForm.items.items;
-        var columnWidthCount = 0;
-        Ext.each(items, function(item, index){
-            if(item.xtype != 'hidden'){
-                columnWidthCount+= item.columnWidth
-            }
-        });
-        columnWidthCount = Math.ceil(columnWidthCount);
-        var count = window.innerHeight - 110>=800?2:1;
-        if(columnWidthCount>count){
-            //展开
-            queryForm.animate({dynamic: true, duration: 500, to: {height: (24+42*columnWidthCount)+'px'}})
-            queryForm.dockedItems.items[0].down('[name=showMore]').hide();
-            queryForm.dockedItems.items[0].down('[name=hideMore]').show();
-            var b = queryForm.dockedItems.items[0].down('[name=query]');
-            b.removeFocusCls();
-        }
-    },
-    hideMore:function (){
-        var me = this,
-        queryPanel = me.getView(),
-        queryForm = queryPanel.down('core-query-queryformpanel');
-        //收缩
-        var count = window.innerHeight - 110>=800?2:1;
-        queryForm.animate({dynamic: true, duration: 500, to: {height: count*56 + 'px'}})
-        queryForm.dockedItems.items[0].down('[name=hideMore]').hide();
-        queryForm.dockedItems.items[0].down('[name=showMore]').show();
-        var b = queryForm.dockedItems.items[0].down('[name=query]');
-        b.removeFocusCls();
-    },
     onMoreQuery: function() {
         var me = this,
         queryPanel = me.getView(),

+ 14 - 4
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -164,7 +164,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             ftype: 'groupingsummary',
             hideGroupedHeader: false,
             enableGroupingMenu: false,
-            collapsible: false
+            collapsible: false,
+            groupHeaderTpl: me.groupHeaderTpl || '{columnName}: {name}'
         }];
 
         if (me.showMySummary) {
@@ -213,7 +214,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                                 })
                                 if (type && d) {
                                     if(typeof c.mySummaryRenderer == 'function') {
-                                        c.summaryValue = c.mySummaryRenderer(grid, datas);
+                                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
                                     }else if (type == 'count') {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
                                     } else if (typeof c.summaryRenderer == 'function') {
@@ -235,6 +236,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             });
                             return datas;
                         } catch (e) {
+                            console.log(e);
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }
                     },
@@ -335,6 +337,12 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         var format = '0.' + xr.join();
                         return Ext.util.Format.number(v, format);
                     },
+                    exportStyle:{
+                        format: 'Total',
+                        alignment: {
+                            horizontal: 'Right'
+                        }
+                    }
                 });
             }
 
@@ -342,7 +350,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
-                    operation: c.summaryType == 'last' ? 'sum' : c.summaryType,
+                    operation: c._summaryType == 'last' ? 'sum' : c._summaryType,
                 });
             }
         })
@@ -368,6 +376,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             column.summaryType = function (records, values) {
                 return values[values.length - 1];
             }
+        }else {
+            column._summaryType = summaryType;
         }
     },
 
@@ -524,7 +534,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
         } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
         } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            type = 'string';
+            type = 'enum';
         } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
         } else {

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

@@ -7,6 +7,7 @@ Ext.define('saas.view.document.address.DataList', {
     viewModel: 'document-address-datalist',
     defaultType:'address',
     windowType:'document-address-window',
+    _openUrl:'api/',
     tbar: ['->',{
         xtype:'button',
         text:'新增',
@@ -26,6 +27,47 @@ Ext.define('saas.view.document.address.DataList', {
                 text: '地址名称',
                 dataIndex: 'ad_address',
                 flex: 1
+            },{
+                text: '采购默认地址',
+                dataIndex: 'ad_default',
+                width:160,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('ad_default')==1){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('ad_default')==1?true:false;
+                        if(type){
+                            saas.util.BaseUtil.showErrorToast('请启用其它未设置的地址');
+                            return;
+                        }
+                        // 启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: form._openUrl+'/'+rec.get('id'),
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showSuccessToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
             }],
             keyField:'id',
             reqUrl: '/api/document/address/save',

+ 2 - 1
frontend/saas-web/app/view/document/address/DataListModel.js

@@ -8,7 +8,8 @@ Ext.define('saas.view.document.address.DataListModel', {
         address: {
             fields:[
                 {name: 'id', type: 'int'},
-                {name: 'ad_address',  type: 'string'}
+                {name: 'ad_address',  type: 'string'},
+                {name: 'ad_default',  type: 'int'}
             ],
             proxy: {
                 type: 'ajax',

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

@@ -19,7 +19,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
     },{
         xtype : "textfield", 
         name : "bo_version", 
-        fieldLabel:'版本'
+        fieldLabel:'版本',
+        emptyText: '全部',
     },{
         xtype: 'combobox',
         name: 'bo_statuscode',
@@ -27,6 +28,7 @@ Ext.define('saas.view.document.bom.BasePanel', {
         displayField: 'bo_status',
         valueField: 'bo_statuscode',
         fieldLabel :'状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['bo_statuscode', 'bo_status'],
@@ -49,6 +51,7 @@ Ext.define('saas.view.document.bom.BasePanel', {
     //字段属性
     _formXtype:'document-bom-formpanel',
     _title:'BOM资料',
+    caller:'Bom',
     _deleteUrl:'/api/document/bom/delete',
     _batchOpenUrl:'/api/document/bom/batchOpen',
     _batchCloseUrl:'/api/document/bom/batchClose',

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

@@ -21,11 +21,13 @@ Ext.define('saas.view.document.customer.BasePanel', {
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         fieldLabel : "客户类型", 
+        emptyText: '全部',
         hiddenBtn:true
     }, {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
-        fieldLabel:'业务员'
+        fieldLabel:'业务员',
+        emptyText: '输入人员编号或姓名',
     },{
         xtype: 'combobox',
         name: 'cu_statuscode',
@@ -33,6 +35,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
         displayField: 'cu_status',
         valueField: 'cu_statuscode',
         fieldLabel :'状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['cu_statuscode', 'cu_status'],

+ 3 - 1
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -22,7 +22,8 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_kind", 
-        fieldLabel : '物料类型'
+        fieldLabel : '物料类型',
+        emptyText: '全部',
     }, {
         xtype: 'combobox',
         name: 'pr_statuscode',
@@ -30,6 +31,7 @@ Ext.define('saas.view.document.product.BasePanel', {
         displayField: 'pr_status',
         valueField: 'pr_statuscode',
         fieldLabel : '状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['pr_statuscode', 'pr_status'],

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

@@ -21,6 +21,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : '供应商类型',
+        emptyText: '全部',
         hiddenBtn:true
     },{
         xtype: 'combobox',
@@ -29,6 +30,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         displayField: 've_status',
         valueField: 've_statuscode',
         fieldLabel : '状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['ve_statuscode', 've_status'],

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

@@ -4,8 +4,6 @@ Ext.define('saas.view.home.Home', {
     id: 'home',
 
     requires: [
-        'Ext.slider.Single',
-        'Ext.form.field.Display',
         'Ext.layout.container.Border',
         'Ext.ux.layout.ResponsiveColumn'
     ],
@@ -37,46 +35,60 @@ Ext.define('saas.view.home.Home', {
     }, {
         xtype: 'panel',
         style: {
-            marginRight: '0',
+            background: '#EEF4F9',
         },
-        // title: '2018年11月经营分析',
+
         latyout: 'responsivecolumn',
         defaults: {
-            margin: '0 0 0 14',
-            userCls: 'big-33 small-50',
+            margin: '0 16 0 0',
+            userCls: 'x-home-chart big-33 small-50',
         },
         items: [{
             xtype: 'month-sale',
+            padding: '0 0 0 14',
         }, {
-            xtype: 'month-purchase',
+            xtype: 'profit-detail',
+            padding: '0 0 0 14',
         }, {
             xtype: 'key-data',
+            margin: 0,
+            padding: '0 0 0 14',
         }]
     }, {
         xtype: 'panel',
-        // title: '2018年11月经营分析',
         latyout: 'responsivecolumn',
         style: {
-            marginRight: '0',
-            marginBottom: '0'
+            background: '#EEF4F9',
         },
         defaults: {
-            margin: '0 0 0 14',
-            userCls: 'big-33 small-50',
+            margin: '0 16 0 0',
+            userCls: 'x-home-chart big-33 small-50',
         },
         items: [{
-            xtype: 'month-io',
-        }, {
             xtype: 'sale-trend',
+            padding: '0 0 0 14',
+        }, {
+            xtype: 'month-io',
+            padding: '0 0 0 14',
         }, {
-        //     xtype: 'purchase-trend'
-        // }, {
-            xtype: 'stock-amount'
+            xtype: 'stock-amount',
+            margin: 0,
+            padding: '0 0 0 14',
         }]
     }],
 
     initComponent: function() {
         this.lastTime = Ext.Date.now();
+        //判断当前是否未完成新手导航
+        saas.util.BaseUtil.request({
+            url: '/api/commons/init/check'
+        }).then(function(res) {
+            if(!res.data.begin){
+                saas.util.BaseUtil.openTab('sys-guide-formpanel', '新手导航', 'sys-guide-formpanel')
+            }
+        }).catch(function(res) {
+            saas.util.BaseUtil.showErrorToast(res.message);
+        })
         this.callParent(arguments);
     },
 

+ 22 - 54
frontend/saas-web/app/view/home/Home.scss

@@ -92,9 +92,11 @@ $unaudit-purc-container-color: dynamic(#e91e63);
 }
 
 .x-home-panel {
+    background: #EEF4F9;
 
     &> .x-autocontainer-outerCt {
         display: block;
+        background: #EEF4F9;
 
         &> .x-autocontainer-innerCt {
             display: block;
@@ -104,6 +106,25 @@ $unaudit-purc-container-color: dynamic(#e91e63);
 
 .x-home-box {
     border-radius: 2px;
+    margin: 0 0 16px 0 !important;
+    
+
+    &:last-child {
+        margin: 0 !important;
+    }
+
+    & > .x-panel-bodyWrap > .x-panel-body >.x-autocontainer-outerCt > .x-autocontainer-innerCt {
+        background: #EEF4F9;
+        display: flex;
+        justify-content: space-around;
+
+        .x-home-chart {
+            background: #fff;
+            border-radius: 4px;
+        }
+    }
+
+    
 
     &>.x-panel-header {
         background-color: #fff;
@@ -137,65 +158,12 @@ $unaudit-purc-container-color: dynamic(#e91e63);
 
     .x-panel-header-default {
         background-color: #fff;
+        padding-right: 14px;
 
         .x-panel-header-title-default > .x-title-icon-wrap-default > .x-title-icon-default,
         .x-panel-header-title-default > .x-title-text-default {
             color: #485465;
         }
     }
-}
-
-.x-responsivecolumn {
-    padding: 0;
-}
-
-.big-100 {
-    // width: 100%;
-    @include responsivecolumn-item(100%);
-}
-
-.big-60 {
-    // width: 60%;
-    @include responsivecolumn-item(60%);
-}
-
-.big-50 {
-    float: left;
-    // width: 50%;
-    @include responsivecolumn-item(50%);
-}
-
-.big-40 {
-    float: left;
-    // width: 40%;
-    @include responsivecolumn-item(40%);
-}
-
-.big-33 {
-    float: left;
-    // width: 33.33%;
-    @include responsivecolumn-item(33.33%);
-}
-
-.big-20 {
-    float: left;
-    // width: 20%;
-    @include responsivecolumn-item(20%);
-}
 
-//--------------------------------------------------------
-// And classes for small-size responsive items
-
- .x-responsivecolumn-small {
-     > .small-100 {
-        float: left;
-        // width: 100%;
-        @include responsivecolumn-item(100%);
-     }
-
-     > .small-50 {
-        float: left;
-        // width: 50%;
-        @include responsivecolumn-item(50%);
-     }
 }

+ 106 - 69
frontend/saas-web/app/view/home/HomeModel.js

@@ -87,41 +87,41 @@ Ext.define('saas.view.home.HomeModel', {
             }
         },
 
-        month_purchase: {
-            model: 'saas.model.chart.DataXY',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
-                url: '/api/commons/homePage/purchaseData?sixMonths=false',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data',
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    }
-                }
-            },
-            listeners: {
-                beforeload: function() {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(true);
-                },
-                load: function(s, d) {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
-                    Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
-                }
-            }
-        },
+        // month_purchase: {
+        //     model: 'saas.model.chart.DataXY',
+        //     autoLoad: true,
+        //     proxy: {
+        //         type: 'ajax',
+        //         // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
+        //         url: '/api/commons/homePage/purchaseData?sixMonths=false',
+        //         timeout: 8000,
+        //         actionMethods: {
+        //             read: 'GET'
+        //         },
+        //         reader: {
+        //             type: 'json',
+        //             rootProperty: 'data',
+        //         },
+        //         listeners: {
+        //             exception: function(proxy, response, operation, eOpts) {
+        //                 var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             }
+        //         }
+        //     },
+        //     listeners: {
+        //         beforeload: function() {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(true);
+        //         },
+        //         load: function(s, d) {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
+        //             Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
+        //         }
+        //     }
+        // },
 
         month_io: {
             fields: ['x', 'main', 'other'],
@@ -202,13 +202,50 @@ Ext.define('saas.view.home.HomeModel', {
             } 
         },
 
-        purchase_trend: {
+        // purchase_trend: {
+        //     fields: ['x', 'y'],
+        //     autoLoad: true,
+        //     proxy: {
+        //         type: 'ajax',
+        //         // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=true',
+        //         url: '/api/commons/homePage/purchaseData?sixMonths=true',
+        //         timeout: 8000,
+        //         actionMethods: {
+        //             read: 'GET'
+        //         },
+        //         reader: {
+        //             type: 'json',
+        //             rootProperty: 'data',
+        //         },
+        //         listeners: {
+        //             exception: function(proxy, response, operation, eOpts) {
+        //                 var p = Ext.getCmp('purchase_trend');
+        //                 p && p.setLoading(false);
+        //             }
+        //         }
+        //     },
+        //     sorters: [
+        //         { property: 'x', direction: 'ASC' }
+        //     ],
+        //     listeners: {
+        //         beforeload: function() {
+        //             var p = Ext.getCmp('purchase_trend');
+        //                 p && p.setLoading(true);
+        //         },
+        //         load: function(s, d) {
+        //             var p = Ext.getCmp('purchase_trend');
+        //                 p && p.setLoading(false);
+        //         }
+        //     } 
+        // },
+
+        stock_amount: {
             fields: ['x', 'y'],
             autoLoad: true,
             proxy: {
                 type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=true',
-                url: '/api/commons/homePage/purchaseData?sixMonths=true',
+                // url: 'http://192.168.253.58:8920/homePage/storageData',
+                url: '/api/commons/homePage/storageData',
                 timeout: 8000,
                 actionMethods: {
                     read: 'GET'
@@ -219,7 +256,7 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('purchase_trend');
+                        var p = Ext.getCmp('stock_amount');
                         p && p.setLoading(false);
                     }
                 }
@@ -229,23 +266,23 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    var p = Ext.getCmp('purchase_trend');
-                        p && p.setLoading(true);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    var p = Ext.getCmp('purchase_trend');
-                        p && p.setLoading(false);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(false);
                 }
             } 
         },
 
-        stock_amount: {
-            fields: ['x', 'y'],
+        key_data: {
+            fields: ['name', 'value'],
             autoLoad: true,
             proxy: {
                 type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/storageData',
-                url: '/api/commons/homePage/storageData',
+                // url: 'http://192.168.253.58:8920/homePage/keyData',
+                url: '/api/commons/homePage/keyData',
                 timeout: 8000,
                 actionMethods: {
                     read: 'GET'
@@ -256,34 +293,40 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('stock_amount');
+                        var p = Ext.getCmp('key_data');
                         p && p.setLoading(false);
                     }
                 }
             },
-            sorters: [
-                { property: 'x', direction: 'ASC' }
-            ],
             listeners: {
                 beforeload: function() {
-                    var p = Ext.getCmp('stock_amount');
-                    p && p.setLoading(true);
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    var p = Ext.getCmp('stock_amount');
-                    p && p.setLoading(false);
+                    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);
+                    }
                 }
             } 
         },
 
-        key_data: {
-            fields: ['name', 'value'],
+        profit_detail: {
+            fields: ['x', 'y', 'z'],
             autoLoad: true,
             proxy: {
                 type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/keyData',
-                url: '/api/commons/homePage/keyData',
+                // url: 'http://192.168.253.58:8560/api/commons/homePage/monthProfit',
+                url: '/api/commons/homePage/monthProfit',
                 timeout: 8000,
+                // header: {
+                //     Authorization: 'eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJnIiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjM4LCJjb21wYW55SWQiOjIxLCJ1c2VyTmFtZSI6ImciLCJyZWFsTmFtZSI6Iue-pCIsImV4cCI6MTU0NjIyNTg5Mn0.oe6BmpVchOlL6PoR7UspHbThFEJ_HLlKTHBpV4P9wSA4YbL2Pv5sAah2U6M2q7nmu0J1DV5WwMaMClI19Us7n-8fSgNeQrl1IsVFO4sf5nSC3SrUJk0sraBq5dLAqONfAIj9qFOuyduL6tXkV2av5IfmikT1uMk8okTJKDtHj8U'
+                // },
                 actionMethods: {
                     read: 'GET'
                 },
@@ -293,25 +336,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('key_data');
+                        var p = Ext.getCmp('profit_detail');
                         p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    var p = Ext.getCmp('key_data');
+                    var p = Ext.getCmp('profit_detail');
                         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);
-                    }
+                    var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(false);
                 }
             } 
         },

+ 47 - 26
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -19,13 +19,13 @@ Ext.define('saas.view.home.charts.KeyData', {
                             '<div class="x-icon x-icon-{icon}"></div>',
                         '</tpl>',
                         '<div class="x-text',
-                            // '<tpl if="!showIcon">',
-                            //     ' x-text-small',
-                            // '</tpl>',
+                            '<tpl if="!showIcon">',
+                                ' x-text-small',
+                            '</tpl>',
                         '">',
-                            // '<tpl if="!showIcon">',
-                            //     '<div class="x-icon-small x-icon-{icon}"></div>',
-                            // '</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>',
@@ -91,11 +91,11 @@ Ext.define('saas.view.home.charts.KeyData', {
                     r.set('value', d);
                 });
             },
-            // updateShowIcon: function(show) {
-            //     this.each(function(r) {
-            //         r.set('showIcon', show);
-            //     });
-            // }
+            updateShowIcon: function(show) {
+                this.each(function(r) {
+                    r.set('showIcon', show);
+                });
+            }
         });
         var view = Ext.create('Ext.view.View', {
             store: store,
@@ -104,6 +104,27 @@ Ext.define('saas.view.home.charts.KeyData', {
             listeners: {
                 itemclick: function(th, record, item, index, e, eOpts) {
                     saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
+                },
+                itemmouseenter: function(th, record, item, index, e, eOpts) {
+                    var tip = th.tip;
+                    if(!tip) {
+                        var tip = Ext.create('Ext.tip.ToolTip', {
+                            target: th.el,
+                            minWidth: 100,
+                            title: record.get('label'),
+                            html: record.get('value'),
+                            showOnTap: true,
+                            trackMouse: true
+                        });
+                        th.tip = tip;
+                        tip.showAt(e.getXY());
+                    }
+                },
+                itemmouseleave: function(th, record, item, index, e, eOpts) {
+                    var tip = th.tip;
+                    if(tip) {
+                        th.tip = Ext.destroy(th.tip);
+                    }
                 }
             }
         });
@@ -118,15 +139,15 @@ Ext.define('saas.view.home.charts.KeyData', {
     },
 
     listeners: {
-        // afterlayout: function() {
-        //     var me = this,
-        //     box = me.getBox(),
-        //     view = me.view,
-        //     width = box.width,
-        //     store = view.store;
-
-        //     store.updateShowIcon(width >= 450);
-        // },
+        afterlayout: function() {
+            var me = this,
+            box = me.getBox(),
+            view = me.view,
+            width = box.width,
+            store = view.store;
+
+            store.updateShowIcon(width >= 450);
+        },
     },
 
     updateValue: function(datas) {
@@ -137,11 +158,11 @@ Ext.define('saas.view.home.charts.KeyData', {
         store.updateValue(datas);
     },
 
-    // updateShowIcon: function(showIcon) {
-    //     var me = this,
-    //     view = me.view,
-    //     store = view.store;
+    updateShowIcon: function(showIcon) {
+        var me = this,
+        view = me.view,
+        store = view.store;
 
-    //     store.updateShowIcon(showIcon);
-    // }
+        store.updateShowIcon(showIcon);
+    }
 });

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

@@ -35,6 +35,7 @@
                     background-position: center;
 
                     &-small {
+                        opacity: 0.7;
                         width: 36px;
                         height: 36px;
                         position: relative;
@@ -79,17 +80,25 @@
                         align-items: flex-start;
                         font-size: 16px;
                         color: #1E2429;
+                        text-overflow: ellipsis;
+                        overflow: hidden;
                     }
 
                     &-small {
                         display: block;
 
                         .x-key {
+                            text-align: end;
                             display: block;
                             padding-left: 54px;
                             margin-top: -17px;
                             margin-bottom: 14px;
                         }
+
+                        .x-value {
+                            display: block;
+                            text-align: end;
+                        }
                     }
                 }
             }

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

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

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

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.Payment', {
     codeField: 'pi_inoutno',
     // detailTitle: '采购验收单',
     // detailXType: 'purchase-purchasein-formpanel',
-    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and ( TO_DAYS(pi_date) + ifnull(ve_promisedays,0)-TO_DAYS(now()) ) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
     listColumns: [{
         text: 'id',
         dataIndex: 'pu_id',

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

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.Recment', {
     codeField: 'pi_inoutno',
     // detailTitle: '出货单',
     // detailXType: 'sale-saleout-formpanel',
-    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
+    condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and (TO_DAYS(pi_date) + ifnull(cu_promisedays,0) - TO_DAYS(now())) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
     listColumns: [{
         text: 'id',
         dataIndex: 'id',
@@ -53,6 +53,9 @@ Ext.define('saas.view.home.infoCardList.Recment', {
         xtype:'numbercolumn',
         width: 100,
         renderer : function(v) {
+            if (v == 0) {
+                v= '';
+            }
             var format = '0'
             return Ext.util.Format.number(v, format);
         }

+ 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">企云服</div></div>',
+                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">U企云服</div></div>',
                     bind: {
                         width: '{navWidth}'
                     }

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

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

+ 2 - 0
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -20,10 +20,12 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
         xtype : "bandinfoDbfindTrigger",
         name : "ftd_bankname",
         fieldLabel : "转出账户",
+        emptyText: '输入账户编号或名称',
     },{
         xtype : "bandinfoDbfindTrigger",
         name : "ftd_inbankname",
         fieldLabel : "转入账户",
+        emptyText: '输入账户编号或名称',
     },{
         xtype: 'combobox',
         name: 'ft_statuscode',

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

@@ -7,7 +7,8 @@ Ext.define('saas.view.money.report.AccountBalance', {
 
     viewName: 'money-report-accountbalance',
 
-    groupField: 'bankname',
+    groupField: 'bankcode',
+    groupHeaderTpl: '账户名称: {[values.rows[0].data.bankname]}',
     listUrl: '/api/money/report/accountBalance',
     defaultCondition: null,
     reportTitle: '账户收支明细表',

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

@@ -90,11 +90,23 @@ Ext.define('saas.view.money.report.AccountDetails', {
         text: '本期核销金额',
         dataIndex: 'sl_amount',
         xtype: 'numbercolumn',
-        width: 130
+        width: 130,
+        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);
+        }
     }, {
         text: '总金额',
         dataIndex: 'total',
         xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        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);
+        }
     }],
 });

+ 37 - 17
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -75,30 +75,44 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         text: '数量',
         xtype: 'numbercolumn',
         dataIndex: 'qty',
-        xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '单价',
         dataIndex: 'pd_orderprice',
         xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '税率',
         dataIndex: 'pd_taxrate',
         xtype: 'numbercolumn',
-        width: 80
+        width: 80,
+        renderer: function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
     }, {
         text: '金额',
         xtype: 'numbercolumn',
         width: 110,
         dataIndex: 'pd_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);
-        // },
+        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('.');
@@ -110,19 +124,25 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         text: '不含税单价',
         width: 110,
         dataIndex: 'pd_netprice',
-        xtype: 'numbercolumn'
+        xtype: 'numbercolumn',
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '不含税金额',
         width: 110,
         xtype: 'numbercolumn',
         dataIndex: 'pd_nettotal',
         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);
-        // },
+        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('.');

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

@@ -10,7 +10,8 @@ Ext.define('saas.view.money.report.OtherIODetail', {
 
     viewName: 'money-report-otheriodetail',
 
-    groupField: 'bl_bankname',
+    groupField: 'bl_bankcode',
+    groupHeaderTpl: '资金账户: {[values.rows[0].data.bankname]}',
     listUrl: '/api/money/report/otheriodetail',
     defaultCondition: null,
     reportTitle: '其他收支明细表',

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

@@ -6,7 +6,8 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pd_vendname',
+    groupField:'pd_vendcode',
+    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendcode]}',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
@@ -26,125 +27,124 @@ Ext.define('saas.view.money.report.PayDetail', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'pd_id',
-            hidden: true
-        }, {
-            text: '单据日期',
-            xtype: 'datecolumn',
-            dataIndex: 'pd_date',
-            width: 110
-        }, {
-            text: '单号',
-            dataIndex: 'pd_code',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'pd_kind',
-            width: 110
-        }, {
-            text:'供应商编号',
-            dataIndex:'pd_vendcode',
-            width: 150,
-            hidden: true
-        },{
-            text:'供应商名称',
-            width: 200,
-            dataIndex:'pd_vendname',
-            hidden: true
-        },{
-            text: '采购员',
-            dataIndex: 'pd_buyername',
-            width: 110
-        },{
-            text: '增加应付',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_addpay',
-            xtype: 'numbercolumn',
-            width: 180,
-            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: '增加预付',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_addpre',
-            xtype: 'numbercolumn',
-            width: 180,
-            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: '应付余额',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_remain',
-            xtype: 'numbercolumn',
-            width: 110,
-            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: '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 = [];
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'pd_id',
+        hidden: true
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'pd_date',
+        width: 110
+    }, {
+        text: '单号',
+        dataIndex: 'pd_code',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pd_kind',
+        width: 110
+    }, {
+        text:'供应商编号',
+        dataIndex:'pd_vendcode',
+        width: 150,
+        hidden: true
+    },{
+        text:'供应商名称',
+        width: 200,
+        dataIndex:'pd_vendname',
+        hidden: true
+    },{
+        text: '采购员',
+        dataIndex: 'pd_buyername',
+        width: 110
+    },{
+        text: '增加应付',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_addpay',
+        xtype: 'numbercolumn',
+        width: 180,
+        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: '增加预付',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_addpre',
+        xtype: 'numbercolumn',
+        width: 180,
+        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: '应付余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_remain',
+        xtype: 'numbercolumn',
+        width: 110,
+        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: '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;
+            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;
-                }
+                lasts[groupField] = v;
+            }
 
-                keys = Ext.Object.getAllKeys(lasts);
-                arr = keys.map(function(key) {
-                    return lasts[key];
-                });
+            keys = Ext.Object.getAllKeys(lasts);
+            arr = keys.map(function(key) {
+                return lasts[key];
+            });
 
-                return Ext.Array.sum(arr);
-            }
-        }, {
-            text: '供应商名称',
-            dataIndex: 'pd_vendname',
-            hidden:true
-        }, {
-            flex: 1
-        }]
+            return Ext.Array.sum(arr);
+        }
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pd_vendname',
+        hidden:true
+    }, {
+        flex: 1
+    }]
 });

+ 76 - 24
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -11,60 +11,112 @@ Ext.define('saas.view.money.report.ProfitDetail', {
     viewName: 'money-report-profitdetail',
 
     groupField: null,
-    listUrl: '/api/money/report/recDetail',
+    listUrl: '/api/money/report/profitdetails',
     defaultCondition: null,
     reportTitle: '毛利润分析表',
-    QueryWidth: 0.25,
+    QueryWidth: 0.2,
     searchItems: [{
         xtype: 'customerDbfindTrigger',
         name: 'pi_custname',
-        fieldLabel: '客户名称',
-        columnWidth: 0.25
+        emptyText: '客户',
+        columnWidth: 0.15,
+        dbfinds:[
+            {
+                from:'cu_name',to:'pi_custname'
+            }]
     }, {
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         emptyText : "客户类型", 
-        columnWidth: 0.25,
+        columnWidth: 0.15,
         hiddenBtn:true
     }, {
         xtype: 'condatefield',
-        name: 'rb_date',
+        name: 'pi_date',
         fieldLabel: '日期',
-        columnWidth: 0.25
+        columnWidth: 0.5
     }],
 
     reportColumns: [{
-        text: '客户编号',
-        dataIndex: 'pi_inoutno',
-        width: 200
-    }, {
+        text: '客户',
+        dataIndex: 'pi_custname',
+        width: 200,
+    },{
         text: '客户类型',
-        dataIndex: 'pi_custcode',
+        dataIndex: 'cu_type',
         width: 200,
     }, {
         text: '业务员',
-        dataIndex: 'pi_custname',
+        dataIndex: 'cu_sellername',
         width: 200,
     }, {
         text: '销售总额',
-        dataIndex: 'pi_class',
-        width: 150
+        dataIndex: 'saamount',
+        xtype: 'numbercolumn',
+        width: 110,
+        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: 'pu_buyername',
-        width: 150
+        dataIndex: 'netamount',
+        xtype: 'numbercolumn',
+        width: 110,
+        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);
+        },
     }, {
         text: '成本金额',
-        dataIndex: 'rb_date',
-        width: 150
+        dataIndex: 'costamount',
+        xtype: 'numbercolumn',
+        width: 110,
+        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);
+        },
     }, {
         text: '毛利润',
-        dataIndex: 'pd_pdno',
-        width: 150,
+        dataIndex: 'profit',
+        xtype: 'numbercolumn',
+        width: 110,
+        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: 'cu_beginaramount',
-        width: 150
+        text: '毛利率%',
+        dataIndex: 'profitpresent',
+        width: 130,
+        xtype: 'numbercolumn',
+        renderer: function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    },{
+        flex: 1
     }]
 });

+ 124 - 123
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'rd_custname',
+    groupField: 'rd_custcode',
+    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
@@ -27,130 +28,130 @@ Ext.define('saas.view.money.report.RecDetail', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'rd_id',
-            hidden: true
-        }, {
-            text: '单据日期',
-            xtype: 'datecolumn',
-            dataIndex: 'rd_date',
-            width: 110
-        }, {
-            text: '单号',
-            dataIndex: 'rd_code',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'rd_kind',
-            width: 110
-        },{
-            text: '客户编号',
-            dataIndex: 'pi_custcode',
-            width: 150,
-            hidden: true
-        }, {
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 200,
-            hidden: true
-        },{
-            text: '业务员',
-            dataIndex: 'rd_sellername',
-            width: 110
-        }, {
-            text: '序号',
-            dataIndex: 'rd_detno',
-            xtype: 'numbercolumn',
-            width: 80,
-            hidden: true
-        },{
-            text:'增加应收',
-            dataIndex:'rd_addrec',
-            xtype: 'numbercolumn',
-            width: 110,
-            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:'增加预收',
-            xtype: 'numbercolumn',
-            dataIndex:'rd_addpre',
-            xtype: 'numbercolumn',
-            width: 180,
-            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: '应收余额',
-            xtype: 'numbercolumn',
-            dataIndex: 'rd_remain',
-            xtype: 'numbercolumn',
-            width: 110,
-            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: '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 = [];
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'rd_id',
+        hidden: true
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'rd_date',
+        width: 110
+    }, {
+        text: '单号',
+        dataIndex: 'rd_code',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'rd_kind',
+        width: 110
+    },{
+        text: '客户编号',
+        dataIndex: 'pi_custcode',
+        width: 150,
+        hidden: true
+    }, {
+        text: '客户名称',
+        dataIndex: 'pi_custname',
+        width: 200,
+        hidden: true
+    },{
+        text: '业务员',
+        dataIndex: 'rd_sellername',
+        width: 110
+    }, {
+        text: '序号',
+        dataIndex: 'rd_detno',
+        xtype: 'numbercolumn',
+        width: 80,
+        hidden: true
+    },{
+        text:'增加应收',
+        dataIndex:'rd_addrec',
+        xtype: 'numbercolumn',
+        width: 110,
+        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:'增加预收',
+        xtype: 'numbercolumn',
+        dataIndex:'rd_addpre',
+        xtype: 'numbercolumn',
+        width: 180,
+        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: '应收余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'rd_remain',
+        xtype: 'numbercolumn',
+        width: 110,
+        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: '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) {
+            datas = 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;
+            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;
-                }
+                lasts[groupField] = v;
+            }
 
-                keys = Ext.Object.getAllKeys(lasts);
-                arr = keys.map(function(key) {
-                    return lasts[key];
-                });
+            keys = Ext.Object.getAllKeys(lasts);
+            arr = keys.map(function(key) {
+                return lasts[key];
+            });
 
-                return Ext.Array.sum(arr);
-            }
-        }, {
-            text: '客户名称',
-            dataIndex: 'rd_custname',
-            hidden:true
-        }, {
-            flex: 1
-        }]
+            return Ext.Array.sum(arr);
+        }
+    }, {
+        text: '客户名称',
+        dataIndex: 'rd_custname',
+        hidden:true
+    }, {
+        flex: 1
+    }]
 });

+ 54 - 7
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -42,25 +42,72 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         dataIndex: 'vm_vendname',
         width: 200,
     }, {
+        text: '期初预付',
+        xtype: 'numbercolumn',
+        dataIndex: 'vm_beginpreamount',
+        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);
+        }
+    },{
         text: '期初应付',
         xtype: 'numbercolumn',
         dataIndex: 'vm_beginamount',
-        width: 150
+        width: 110,
+        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);
+        }
     }, {
-        text: '增加应付',
+        text: '本期应付',
         xtype: 'numbercolumn',
         dataIndex: 'vm_nowamount',
-        width: 150
+        width: 110,
+        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);
+        }
     }, {
-        text: '增加预付',
+        text: '本期核销',
         xtype: 'numbercolumn',
-        dataIndex: 'vm_nowpreamount',
-        width: 150
+        dataIndex: 'vm_nowpayamount',
+        width: 110,
+        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);
+        }
     }, {
+        text: '预付余额',
+        dataIndex: 'vm_endpreamount',
+        xtype: 'numbercolumn',
+        width: 110,
+        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: 'vm_endamount',
         xtype: 'numbercolumn',
-        width: 150,
+        width: 110,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

+ 47 - 6
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -42,19 +42,60 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         dataIndex: 'cm_custname',
         width: 200,
     }, {
+        text: '期初预收',
+        dataIndex: 'cm_beginpreamount',
+        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);
+        }
+    },{
         text: '期初应收',
         dataIndex: 'cm_beginamount',
-        width: 150
+        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);
+        }
     }, {
-        text: '增加应收',
+        text: '本期应收',
         xtype: 'numbercolumn',
         dataIndex: 'cm_nowamount',
-        width: 150
+        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);
+        }
     }, {
-        text: '增加预收',
+        text: '本期核销',
         xtype: 'numbercolumn',
-        dataIndex: 'cm_nowpreamount',
-        width: 150
+        dataIndex: 'cm_nowpayamount',
+        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);
+        }
+    }, {
+        text: '预收余额',
+        xtype: 'numbercolumn',
+        dataIndex: 'cm_endpreamount',
+        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);
+        }
     }, {
         text: '应收余额',
         dataIndex: 'cm_endamount',

+ 39 - 25
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -52,6 +52,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
         width: 150
     },  {
         text: '序号',
+        xtype: 'numbercolumn',
         dataIndex: 'pd_pdno',
         width: 80
     },{
@@ -62,7 +63,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
     },{
         text:'供应商名称',
         dataIndex:'pi_vendname',
-        width: 200,
+        width: 250,
         hidden:true
     },{
         text: '物料编号',
@@ -82,45 +83,46 @@ Ext.define('saas.view.money.report.VendorCheck', {
         width: 80
     }, {
         text: '数量',
-        xtype: 'numbercolumn',
         dataIndex: 'qty',
         xtype: 'numbercolumn',
         width: 110,
-        // renderer : function(v) {
-        //     var arr = (v + '.').split('.');
-        //     var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            //    var format = '0.' + 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 > 3 ? 3 : arr[1].length)).fill('0');
-            //    var format = '0.' + xr.join();
-        //     return Ext.util.Format.number(v, format);
-        // }
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '单价',
         dataIndex: 'pd_orderprice',
         xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '税率',
         dataIndex: 'pd_taxrate',
         xtype: 'numbercolumn',
-        width: 80
+        width: 80,
+        renderer: function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
     }, {
         text: '金额',
         xtype: 'numbercolumn',
         dataIndex: 'pd_total',
         xtype: 'numbercolumn',
         width: 110,
-        // 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);
-        // },
+        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('.');
@@ -132,12 +134,24 @@ Ext.define('saas.view.money.report.VendorCheck', {
         text: '不含税单价',
         dataIndex: 'pd_netprice',
         xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        renderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '不含税金额',
         dataIndex: 'pd_nettotal',
         xtype: 'numbercolumn',
-        width: 110
+        width: 110,
+        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);
+        },
     }, {
         text: '单据类型',
         dataIndex: 'pi_class',

+ 16 - 0
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -533,6 +533,8 @@ Ext.define('saas.view.money.verification.FormPanelController', {
         })
         store.removeAll();
         store.add(datas);
+        // 不写该方法合计列会错位,这里触发afterEdit事件用来刷新grid
+        store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
     },
 
     onSave: function() {
@@ -668,4 +670,18 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             form.fireEvent('afteraudit', false, form, res);
         });
     },
+    myInitCopyData: function(formData) {
+        var me = this,
+        form = me.getView();
+        //录入人,录入日期,审核人,审核日期清空
+        formData.main['creatorId'] = saas.util.BaseUtil.getCurrentUser().id;
+        formData.main['creatorName'] = saas.util.BaseUtil.getCurrentUser().realname;
+        formData.main['createTime'] = Ext.Date.format(new Date(), 'Y-m-d H:i:s');
+        formData.main['updaterId'] = undefined;
+        formData.main['updaterName'] = undefined;
+        formData.main['updateTime'] = undefined;
+        formData.main[form._auditmanField] = undefined;
+        formData.main[form._auditdateField] = undefined;
+        return formData;
+    }
 });

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

@@ -66,7 +66,8 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pu_sacode',
-        fieldLabel: '关联销售单号'
+        fieldLabel: '关联销售单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

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

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

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

@@ -70,7 +70,9 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_pucode',
-        fieldLabel: '关联采购单号'
+        fieldLabel: '关联采购单号',
+        emptyText: '输入单号',
+
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

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

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

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

@@ -70,7 +70,8 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_iocode',
-        fieldLabel: '关联验收单号'
+        fieldLabel: '关联验收单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

+ 15 - 1
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
 
     viewName: 'purchase-report-purchasepay',
 //按供应商分组 付款金额合计
-    groupField: 'pu_vendname',
+    groupField: 'pu_vendcode',
+    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pu_vendname]}',
     listUrl: '/api/purchase/report/purchasePay',
     defaultCondition: null,
     reportTitle: '采购付款一览表',
@@ -36,6 +37,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         width: 150
     }, {
         text: '供应商编号',
+        id: 'pu_vendcode',
         dataIndex: 'pu_vendcode',
         width: 150
     }, {
@@ -66,6 +68,12 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         xtype: 'numbercolumn',
         width: 110,
         summaryType: 'sum',
+        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);
+        },
         summaryRenderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -78,6 +86,12 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         xtype: 'numbercolumn',
         width: 110,
         summaryType: 'sum',
+        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);
+        },
         summaryRenderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

+ 2 - 2
frontend/saas-web/app/view/sale/report/Sale.js

@@ -157,7 +157,7 @@ Ext.define('saas.view.sale.report.Sale', {
         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();
+            var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',
@@ -175,7 +175,7 @@ Ext.define('saas.view.sale.report.Sale', {
         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();
+            var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',

+ 1 - 1
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -25,7 +25,7 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         columnWidth: 0.2
     }, {
         xtype: 'condatefield',
-        name: 'sa_date',
+        name: 'pi_date',
         fieldLabel: '时间',
         columnWidth: 0.4
     }],

+ 2 - 1
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -7,7 +7,8 @@ Ext.define('saas.view.sale.report.SaleRec', {
 
     viewName: 'sale-report-salerec',
 
-    groupField: 'rb_custname',
+    groupField: 'rb_custcode',
+    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
     listUrl: '/api/sale/report/saleRec',
     defaultCondition: null,
     reportTitle: '销售收款报表',

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

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

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

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

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

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

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

@@ -24,6 +24,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         xtype: 'productDbfindTrigger',
         name: 'pr_detail',
         fieldLabel: '物料',
+        emptyText: '输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -62,15 +63,18 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
     }, {
         xtype: 'warehouseDbfindTrigger',
         name: 'pd_whname',
-        fieldLabel: '仓库'
+        fieldLabel: '仓库',
+        emptyText: '输入仓库编号或名称',
     }, {
         xtype: 'textfield',
         name: 'pi_iocode',
-        fieldLabel: '关联出货单号'
+        fieldLabel: '关联出货单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',
         fieldLabel: '录入人',
+        emptyText: '输入人员编号或姓名',
         getCondition: function(value) {
             if(!value) {
                 return '1=1';
@@ -81,7 +85,8 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'pi_auditman',
-        fieldLabel: '审核人'
+        fieldLabel: '审核人',
+        emptyText: '输入人员编号或姓名',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -138,7 +143,8 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         },{
             text: '业务员',
             dataIndex: 'sa_seller',
-            width: 90
+            width: 90,
+            hidden :true
         },{
             text: '审核人',
             dataIndex: 'pi_auditman',

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

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

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

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

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

@@ -24,6 +24,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         xtype: 'productDbfindTrigger',
         name: 'pr_detail',
         fieldLabel: '物料',
+        emptyText: '输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -67,11 +68,13 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_sacode',
-        fieldLabel: '关联销售单号'
+        fieldLabel: '关联销售单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',
         fieldLabel: '录入人',
+        emptyText: '输入人员编号或姓名',
         getCondition: function(value) {
             if(!value) {
                 return '1=1';
@@ -82,7 +85,8 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'pi_auditman',
-        fieldLabel: '审核人'
+        fieldLabel: '审核人',
+        emptyText: '输入人员编号或姓名',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -133,7 +137,8 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         },{
             text: '业务员',
             dataIndex: 'sa_seller',
-            width: 90
+            width: 90,
+            hidden :true
         },{
             text: '审核人',
             dataIndex: 'pi_auditman',

+ 17 - 18
frontend/saas-web/app/view/stock/inventory/EditDataList.js

@@ -29,37 +29,36 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         ptype: 'menuclipboard'
     }],
     tbar: [{
+        xtype: 'textfield',
+        name: 'pr_detail',
+        emptyText:'输入物料编号或名称',
+        width:200,
+        bind: '{form.pr_detail}',
+        getCondition: function(v) {
+            if(v) {
+                return "(upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+            }else {
+                return '1 = 1';
+            }
+        }
+    },{
         xtype: 'warehouseDbfindTrigger',
         name: 'wh_description',
         bind: '{form.wh_description}',
-        emptyText: '仓库',
+        fieldLabel: '仓库',
         dbfinds:[{
             from:'wh_description',to:'wh_description'
         }],
-        width:150,
+        //width:150,
     },{
         editable:true,
         xtype : "remotecombo", 
         storeUrl:'/api/document/producttype/getCombo',
         name : "pr_kind",
         bind: '{form.pr_kind}',
-        emptyText : "类型",
+        fieldLabel : "类型",
         hiddenBtn:true,
-        width:150
-    },{
-        // xtype: 'productDbfindTrigger',
-        xtype: 'textfield',
-        name: 'pr_detail',
-        emptyText:'输入物料编号或名称',
-        width:200,
-        bind: '{form.pr_detail}',
-        getCondition: function(v) {
-            if(v) {
-                return "(upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
-            }else {
-                return '1 = 1';
-            }
-        }
+        //width:150
     },{
         cls:'x-formpanel-btn-blue',
         xtype:'button',

+ 20 - 62
frontend/saas-web/app/view/stock/report/DataList.js

@@ -12,7 +12,7 @@ Ext.define('saas.view.stock.report.DataList', {
     // listUrl: 'http://192.168.253.41:8560/api/document/product/ReserveCost',
     defaultCondition: null,
     reportTitle: '物料库存数量金额表',
-    QueryWidth: 0.4,
+    QueryWidth: 0.65,
     printAble: false,
     exportAble: true,
     queryMode: 'MAIN',
@@ -30,6 +30,7 @@ Ext.define('saas.view.stock.report.DataList', {
         xtype: 'textfield',
         emptyText: '仓库编号/名称',
         columnWidth: 0.25,
+        hidden: true,
         getCondition: function (v) {
             return "(upper(wh_code) like '%" + v.toUpperCase() + "%' or upper(wh_description) like '%" + v.toUpperCase() + "%')";
         }
@@ -46,7 +47,7 @@ Ext.define('saas.view.stock.report.DataList', {
         }
     }],
 
-    reportColumns2: [{
+    reportColumns: [{
         text: "物料编号",
         width: 200,
         dataIndex: "rc_prodCode",
@@ -59,105 +60,62 @@ Ext.define('saas.view.stock.report.DataList', {
         text: "物料规格",
         dataIndex: "rc_prodSpec",
         width: 200,
-    }, {
-        text: "单位",
-        dataIndex: "rc_prodUnit",
-        width: 150,
-    }, {
+    },  {
         text: "仓库编号",
         dataIndex: "rc_whCode",
         width: 200,
+        hidden:true
     }, {
         text: "仓库名称",
         dataIndex: "rc_whName",
-        width: 200,
+        hidden: true,
+        toggle: true,
+        width: 110,
     }, {
         text: "数量",
         xtype: 'numbercolumn',
         dataIndex: "rc_number",
-        width: 150,
+        width: 120,
         renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
+    },{
+        text: "单位",
+        dataIndex: "rc_prodUnit",
+        width: 80
     }, {
         text: "单价",
         xtype: 'numbercolumn',
+        hidden: true,
+        toggle: true,
         align: 'end',
         dataIndex: "rc_price",
-        width: 150,
+        width: 120,
         renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 8 ? 8 : 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: [{
-        text: "物料编号",
-        width: 200,
-        dataIndex: "rc_prodCode",
-        xtype: "",
-    }, {
-        text: "物料名称",
-        width: 200,
-        dataIndex: "rc_prodDetail",
-    }, {
-        text: "物料规格",
-        dataIndex: "rc_prodSpec",
-        width: 200,
-    }, {
-        text: "单位",
-        dataIndex: "rc_prodUnit",
-        width: 150,
-    }, {
-        text: "数量",
-        xtype: 'numbercolumn',
-        dataIndex: "rc_number",
-        width: 150,
-        renderer: function (v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join();
+            var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
     }, {
         text: "金额",
         xtype: 'numbercolumn',
         dataIndex: "rc_amount",
-        width: 150,
+        width: 120,
         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();
+            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.' + xr.join();
+            var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
     }, {

Some files were not shown because too many files changed in this diff