Browse Source

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

chenw 7 years ago
parent
commit
12d334792a
99 changed files with 1386 additions and 476 deletions
  1. 8 0
      applications/commons/commons-server/src/main/resources/application.yml
  2. 0 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  3. 8 0
      applications/document/document-server/src/main/resources/application.yml
  4. 10 2
      applications/money/money-server/src/main/resources/application.yml
  5. 1 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  6. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java
  7. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java
  8. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  9. 3 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  10. 14 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  11. 13 21
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  12. 8 0
      applications/purchase/purchase-server/src/main/resources/application.yml
  13. 13 7
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  14. 84 32
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  15. 2 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdIODetailDTO.java
  16. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  17. 3 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java
  18. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  19. 22 3
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  20. 8 0
      applications/sale/sale-server/src/main/resources/application.yml
  21. 3 2
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  22. 1 1
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  23. 5 1
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  24. 2 2
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  25. 9 1
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  26. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdIODetail.java
  27. 8 0
      applications/storage/storage-server/src/main/resources/application.yml
  28. 1 1
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/AccountCache.java
  29. 1 1
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/ResourceCache.java
  30. 5 1
      base-servers/account/account-server/src/main/resources/application.yml
  31. 2 1
      base-servers/auth/auth-client/src/main/java/com/usoftchina/saas/auth/client/interceptor/AuthRestInterceptor.java
  32. 7 0
      base-servers/auth/auth-server/src/main/resources/application.yml
  33. 21 12
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  34. 6 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/WebConfig.java
  35. 28 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/interceptor/ServiceFeignInterceptor.java
  36. 4 0
      base-servers/gateway-server/src/main/resources/application.yml
  37. 4 0
      base-servers/ui-server/src/main/resources/application.yml
  38. 16 2
      framework/core/src/main/java/com/usoftchina/saas/cache/BaseRedisCache.java
  39. 1 0
      frontend/saas-web/app/model/sale/ProdIODetail.js
  40. 2 2
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  41. 98 5
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  42. 24 15
      frontend/saas-web/app/view/core/form/FormPanelController.js
  43. 2 0
      frontend/saas-web/app/view/core/tab/Controller.js
  44. 57 27
      frontend/saas-web/app/view/document/customer/FormPanel.js
  45. 27 2
      frontend/saas-web/app/view/document/kind/ChildForm.js
  46. 8 1
      frontend/saas-web/app/view/document/kind/Kind.js
  47. 4 0
      frontend/saas-web/app/view/document/kind/KindController.js
  48. 1 1
      frontend/saas-web/app/view/document/kind/KindModel.js
  49. 6 2
      frontend/saas-web/app/view/document/product/FormController.js
  50. 60 37
      frontend/saas-web/app/view/document/product/FormPanel.js
  51. 42 21
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  52. 3 2
      frontend/saas-web/app/view/main/Navigation.js
  53. 2 2
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  54. 1 2
      frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js
  55. 1 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  56. 4 5
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  57. 1 1
      frontend/saas-web/app/view/money/othreceipts/QueryPanel.js
  58. 15 9
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  59. 1 1
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  60. 66 24
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  61. 4 1
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  62. 3 3
      frontend/saas-web/app/view/money/payBalance/QueryPanel.js
  63. 25 36
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  64. 8 0
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  65. 8 27
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  66. 7 1
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  67. 10 11
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  68. 28 20
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  69. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  70. 9 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelModel.js
  71. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  72. 60 23
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  73. 2 2
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  74. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  75. 2 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  76. 1 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  77. 2 2
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  78. 1 1
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  79. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  80. 2 2
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  81. 1 1
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  82. 2 3
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  83. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js
  84. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  85. 1 1
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  86. 1 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  87. 1 1
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  88. 1 1
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  89. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  90. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  91. 1 1
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js
  92. 304 0
      frontend/saas-web/app/view/stock/stockamount/DataList.js
  93. 10 0
      frontend/saas-web/app/view/stock/stockamount/DataListController.js
  94. 4 0
      frontend/saas-web/app/view/stock/stockamount/DataListlModel.js
  95. 51 21
      frontend/saas-web/app/view/sys/config/FormPanel.js
  96. 28 36
      frontend/saas-web/app/view/sys/config/FormPanelController.js
  97. 21 10
      frontend/saas-web/app/view/sys/finish/DataList.js
  98. 11 0
      frontend/saas-web/overrides/i18n.js
  99. 5 1
      frontend/saas-web/resources/json/navigation.json

+ 8 - 0
applications/commons/commons-server/src/main/resources/application.yml

@@ -34,6 +34,14 @@ spring:
   sleuth:
     sampler:
       probability: 1.0
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10

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

@@ -58,8 +58,6 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     @Override
     public void updateLatestPurchasePrice(Long pu_id) {
         getMapper().updateLatestPurchasePrice(pu_id);
-        Product product = getMapper().selectByPrimaryKey(pu_id);
-        messageLogService.update(generateMsgObj(pu_id, product.getPr_code()));
     }
 
     @Override

+ 8 - 0
applications/document/document-server/src/main/resources/application.yml

@@ -48,6 +48,14 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 server:
   port: 9480
   tomcat:

+ 10 - 2
applications/money/money-server/src/main/resources/application.yml

@@ -22,8 +22,8 @@ spring:
     host: 192.168.0.176
     port: 5672
     virtual-host: dev
-    password: saas
-    username: select123***
+    username: saas
+    password: select123***
   zipkin:
     sender:
       type: rabbit
@@ -45,6 +45,14 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 server:
   port: 8880
   tomcat:

+ 1 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -94,8 +94,7 @@ public class PurchaseController {
      */
     @PostMapping("/audit")
     public Result audit(@RequestBody PurchaseFormDTO formData) {
-        DocBaseDTO audit = purchaseService.audit(formData);
-        return Result.success(audit);
+        return purchaseService.audit(formData);
     }
 
     /**

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java

@@ -34,4 +34,7 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
     void calcProdIn(@Param("pi_id") Long pi_id);
 
     void calcProdOut(@Param("pi_id") Long pi_id);
+
+    void getDefaultWarehouseByProduct(@Param("pi_id") Long pi_id);
+
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java

@@ -28,6 +28,8 @@ public interface PurchasedetailMapper extends CommonBaseMapper<Purchase> {
 
     void calcPurchase(Long pu_id);
 
+    String checkzxbzs(Long id);
+
 //    void getVendorTaxrate(Long pu_id);
 //
 //    void getPrice(Long pu_id);

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java

@@ -77,4 +77,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
 
     void calcProdInout(Long pi_id, String pi_class);
 
+    String pushMaxnubmer(ProdInOut prodInOut);
+
+    void getDefaultWarehouseByProduct(Long pi_id);
 }

+ 3 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -71,7 +71,9 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      * @param formData
      * @return
      */
-    DocBaseDTO audit(PurchaseFormDTO formData);
+    Result audit(PurchaseFormDTO formData);
+
+
 
     /**
     * @Description 批量审核

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

@@ -395,6 +395,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_class(BillCodeSeq.PURCHASEOUT.getName());
         targetPi.setPi_date(new Date());
         targetPi.setPi_recorddate(new Date());
+        targetPi.setPi_vendid(sourcePi.getPi_vendid());
         targetPi.setPi_vendcode(sourcePi.getPi_vendcode());
         targetPi.setPi_vendname(sourcePi.getPi_vendname());
         targetPi.setPi_puid(sourcePi.getPi_puid());
@@ -403,7 +404,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
 
-
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入验退单从表
@@ -427,6 +427,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
                  targetPid.setPd_ioid(sourcePid.getId());
                  targetPid.setPd_taxrate(sourcePid.getPd_taxrate());
+                 //仓库信息
+                 targetPid.setPd_whid(sourcePid.getPd_whid());
+                 targetPid.setPd_whcode(sourcePid.getPd_whcode());
+                 targetPid.setPd_whname(sourcePid.getPd_whname());
+
                  //公司id
                  targetPid.setCompanyId(sourcePid.getCompanyId());
                  targetPid.setCreateTime(new Date());
@@ -439,7 +444,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
              }
          }
-
+        //更新默认仓库
+//        getDefaultWarehouseByProduct(pi_id);
         //采购验退单相关计算
         calcProdInout(pi_id,"采购验退单");
         DocBaseDTO baseDTO = new DocBaseDTO();
@@ -530,7 +536,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
 
-    private String pushMaxnubmer(ProdInOut prodInOut) {
+    public String pushMaxnubmer(ProdInOut prodInOut) {
         String pi_inoutno = prodInOut.getPi_inoutno();
         String pi_class = prodInOut.getPi_class();
         Long id = prodInOut.getId();
@@ -549,7 +555,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
     }
 
-
+    @Override
+    @Transactional
+    public void getDefaultWarehouseByProduct(Long pi_id) {
+        prodIODetailMapper.getDefaultWarehouseByProduct(pi_id);
+    }
 
 
     private ProdInOut checkAndReturnOrder (Long id){

+ 13 - 21
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -180,12 +180,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
         baseDTO = getBaseDTOById(pu_id);
 
-        //取供应商汇率
-        getVendorTaxrate(pu_id);
-        //取价
-        getPrice(pu_id);
-
-
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志
@@ -193,14 +187,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         return baseDTO;
     }
 
-    private void getVendorTaxrate(Long pu_id) {
-//        purchasedetailMapper.getVendorTaxrate(pu_id);
-    }
-
-    private void getPrice(Long pu_id) {
-//        purchasedetailMapper.getPrice(pu_id);
-    }
-
 
     @Override
     @Transactional
@@ -220,7 +206,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     @Override
     @Transactional
-    public DocBaseDTO audit(PurchaseFormDTO formData) {
+    public Result audit(PurchaseFormDTO formData) {
         Long id = null;
         DocBaseDTO baseDTO = null;
         if (null != formData) {
@@ -229,9 +215,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 baseDTO = saveFormData(formData);
                 id = baseDTO.getId();
             }
-            singleAudit(id);
+            return singleAudit(id);
         }
-        return baseDTO;
+        return Result.error("数据为空");
     }
 
     @Override
@@ -461,7 +447,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 //公司id
                 prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
                 prodIODetail.setCreateTime(new Date());
-
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);
@@ -470,7 +455,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
             }
         }
-        //采购单相关计算
+        //更新默认仓库
+        prodInOutService.getDefaultWarehouseByProduct(pi_id);
+
+        //采购验收单相关计算
         prodInOutService.calcProdInout(pi_id,"采购验收单");
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setId(pi_id);
@@ -479,7 +467,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         return Result.success(baseDTO);
     }
 
-    private void singleAudit(Long id) {
+    private Result singleAudit(Long id) {
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        Result result = Result.success(docBaseDTO);
+        //检查最小包装数
+        result.setMessage(purchasedetailMapper.checkzxbzs(id));
         Purchase purchase = new Purchase();
         //生成更新对象
         purchase.setId(id);
@@ -491,9 +483,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //更新最新采购单价
         productApi.updateLatestPurchasePrice(id);
-        DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
         messageLogService.audit(docBaseDTO);
+        return result;
     }
 
     private void singleUnAudit(Long id) {

+ 8 - 0
applications/purchase/purchase-server/src/main/resources/application.yml

@@ -48,6 +48,14 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 server:
   port: 8800
   tomcat:

+ 13 - 7
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -740,19 +740,25 @@
 
   <update id="calcProdIn">
     update prodiodetail set pd_netprice = ifnull(pd_orderprice,0)/(1+ifnull(pd_taxrate,0)/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = ifnull(pd_orderprice,0)*ifnull(pd_inqty,0),pd_nettotal = pd_netprice*ifnull(pd_inqty,0) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodinout set pi_total = (select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
-    update prodinout set pi_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodiodetail set pd_total = round(ifnull(pd_orderprice,0)*ifnull(pd_inqty,0),2),pd_nettotal = round(pd_netprice*ifnull(pd_inqty,0),2)  where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_total = round((select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2)  where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_nettotal = round((select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2)  where pi_id = #{pi_id,jdbcType=INTEGER};
   </update>
 
   <update id="calcProdOut">
     update prodiodetail set pd_netprice = ifnull(pd_orderprice,0)/(1+ifnull(pd_taxrate,0)/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = ifnull(pd_orderprice,0)*ifnull(pd_outqty,0),pd_nettotal = pd_netprice*ifnull(pd_outqty,0) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodinout set pi_total = (select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
-    update prodinout set pi_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodiodetail set pd_total = round(ifnull(pd_orderprice,0)*ifnull(pd_outqty,0),2),pd_nettotal = round(pd_netprice*ifnull(pd_outqty,0),2)  where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_total = round((select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2)  where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_nettotal = round((select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2)  where pi_id = #{pi_id,jdbcType=INTEGER};
   </update>
 
-
+  <update id="getDefaultWarehouseByProduct">
+    update prodiodetail
+    set pd_whid=(select pr_whid from product where pd_prodid = pr_id),
+    pd_whcode=(select pr_whcode from product where pd_prodid = pr_id),
+    pd_whname=(select pr_whname from product where pd_prodid = pr_id)
+    where pd_piid = #{pi_id,jdbcType=INTEGER};
+  </update>
 
 
 </mapper>

+ 84 - 32
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -361,32 +361,81 @@
   <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update purchasedetail <set>
-      PD_PUID = #{item.pd_puid},
-      PD_CODE = #{item.pd_code},
-      PD_DETNO = #{item.pd_detno},
-      PD_PRODID = #{item.pd_prodid},
-      PD_PRODCODE = #{item.pd_prodcode},
-      PD_UNIT = #{item.pd_unit},
-      PD_QTY = #{item.pd_qty},
-      PD_PRICE = #{item.pd_price},
-      PD_TAXPRICE = #{item.pd_taxprice},
-      PD_TOTAL = #{item.pd_total},
-      PD_TAXRATE = #{item.pd_taxrate},
-      PD_TAXTOTAL = #{item.pd_taxtotal},
-      PD_ACCEPTQTY = #{item.pd_acceptqty},
-      PD_DELIVERY = #{item.pd_delivery},
-      PD_SALECODE = #{item.pd_salecode},
-      PD_SALEDETNO = #{item.pd_saledetno},
-      PD_SDID = #{item.pd_sdid},
-      companyId = #{item.companyId},
-      updaterId = #{item.updaterId},
-      updateTime = #{item.updateTime},
-      pd_text1 = #{item.pd_text1},
-      pd_text2 = #{item.pd_text2},
-      pd_text3 = #{item.pd_text3},
-      pd_text4 = #{item.pd_text4},
-      pd_text5 = #{item.pd_text5},
-      pd_yqty = #{item.pd_yqty}
+      <if test="item.pd_puid != null" >
+        PD_PUID = #{item.pd_puid,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_code != null" >
+        PD_CODE = #{item.pd_code,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_detno != null" >
+        PD_DETNO = #{item.pd_detno,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_prodid != null" >
+        PD_PRODID = #{item.pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_prodcode != null" >
+        PD_PRODCODE = #{item.pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_unit != null" >
+        PD_UNIT = #{item.pd_unit,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_qty != null" >
+        PD_QTY = #{item.pd_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_price != null" >
+        PD_PRICE = #{item.pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_total != null" >
+        PD_TOTAL = #{item.pd_total,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_taxrate != null" >
+        PD_TAXRATE = #{item.pd_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_taxtotal != null" >
+        PD_TAXTOTAL = #{item.pd_taxtotal,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_acceptqty != null" >
+        PD_ACCEPTQTY = #{item.pd_acceptqty,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_delivery != null" >
+        PD_DELIVERY = #{item.pd_delivery,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_salecode != null" >
+        PD_SALECODE = #{item.pd_salecode,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_saledetno != null" >
+        PD_SALEDETNO = #{item.pd_saledetno,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_sdid != null" >
+        PD_SDID = #{item.pd_sdid,jdbcType=INTEGER},
+      </if>
+      <if test="item.companyId != null" >
+        companyId = #{item.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updaterId != null" >
+        updaterId = #{item.updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updateTime != null" >
+        updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="item.pd_text1 != null" >
+        pd_text1 = #{item.pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text2 != null" >
+        pd_text2 = #{item.pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text3 != null" >
+        pd_text3 = #{item.pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text4 != null" >
+        pd_text4 = #{item.pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text5 != null" >
+        pd_text5 = #{item.pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_yqty != null" >
+        pd_yqty = #{item.pd_yqty,jdbcType=DOUBLE},
+      </if>
       </set>
       where PD_ID = #{item.id,jdbcType=INTEGER}
     </foreach>
@@ -410,15 +459,18 @@
 
   <update id="calcPurchase" parameterType="long" >
     update purchasedetail set pd_taxprice = ifnull(PD_PRICE,0)/(1+ifnull(pd_taxrate,0)/100) where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchasedetail set pd_total = ifnull(PD_PRICE,0)*ifnull(pd_qty,0),pd_taxtotal = pd_taxprice*ifnull(pd_qty,0) where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchase set pu_total = (select sum(pd_total) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
-    update purchase set PU_TAXTOTAL = (select sum(pd_taxtotal) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
+    update purchasedetail set pd_total = round(ifnull(PD_PRICE,0)*ifnull(pd_qty,0),2),pd_taxtotal = round(pd_taxprice*ifnull(pd_qty,0),2) where pd_puid = #{pu_id,jdbcType=INTEGER};
+    update purchase set pu_total = round((select sum(pd_total) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ),2)  where pu_id = #{pu_id,jdbcType=INTEGER};
+    update purchase set PU_TAXTOTAL = round((select sum(pd_taxtotal) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ),2)  where pu_id = #{pu_id,jdbcType=INTEGER};
   </update>
 
 
-
-
-
+  <select id="checkzxbzs" parameterType="long" resultType="string">
+    select GROUP_CONCAT(CONCAT(PD_DETNO,'行',PD_PRODCODE,'物料采购数量不是最小包装数',round(pr_zxbzs,0),'的整数倍')) from purchasedetail left join product on PD_PRODID = pr_id
+    where
+    MOD(PD_QTY,pr_zxbzs)!=0 and
+    PD_PUID = #{id,jdbcType=INTEGER};
+  </select>
 
 
 </mapper>

+ 2 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdIODetailDTO.java

@@ -88,6 +88,8 @@ public class ProdIODetailDTO implements Serializable {
 
     private Long pd_ioid;
 
+    private Double pd_ordertotal;
+
     private ProductDTO productDTO;
 
 }

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -55,4 +55,8 @@ public class SaleDTO extends CommonBaseDTO{
     private String sa_text4;
 
     private String sa_text5;
+
+    private String sa_auditman;
+
+    private Date sa_auditdate;
 }

+ 3 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java

@@ -6,6 +6,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.HashMap;
 import java.util.List;
 
 public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
@@ -40,4 +41,6 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     String validateBatchOpen(List<DocBaseDTO> baseDTOs);
 
     void updatePiTotal(Long id);
+
+    List<HashMap<String, Object>> getWareHouseByCode(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 4 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -54,4 +54,8 @@ public class Sale extends CommonBaseEntity{
     private String sa_text4;
 
     private String sa_text5;
+
+    private String sa_auditman;
+
+    private Date sa_auditdate;
 }

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

@@ -30,9 +30,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author: guq
@@ -238,6 +236,8 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_statuscode(Status.AUDITED.name());
         sale.setUpdateTime(new Date());
         sale.setUpdaterId(BaseContextHolder.getUserId());
+        sale.setSa_auditman("TESTADMIN");
+        sale.setSa_auditdate(new Date());
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);
         //更新销售金额
@@ -462,6 +462,13 @@ public class SaleServiceImpl implements SaleService{
             prodIODetail.setCompanyId(companyId);
             //本次转单数
             prodIODetail.setPd_outqty(saleDetail.getSd_qty() - saleDetail.getSd_yqty());
+            //获取物料默认仓库
+            Map<String, Object> warehouse = getWareHouseByCode(saleDetail.getSd_prodcode());
+            if (null != warehouse) {
+                prodIODetail.setPd_whid(warehouse.get("pr_whid") == null ? 0 : Integer.valueOf(warehouse.get("pr_whid").toString()));
+                prodIODetail.setPd_whcode(String.valueOf(warehouse.get("pr_whcode")));
+                prodIODetail.setPd_whname(String.valueOf(warehouse.get("pr_whname")));
+            }
             prodIODetailMapper.insertSelective(prodIODetail);
             //更新已转数
             saleDetail.setSd_yqty(saleDetail.getSd_qty());
@@ -573,4 +580,16 @@ public class SaleServiceImpl implements SaleService{
         return baseDTO;
     }
 
+    private Map<String, Object> getWareHouseByCode(String code) {
+        if (StringUtils.isEmpty(code)) {
+            return null;
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        List<HashMap<String, Object>> list = prodInOutMapper.getWareHouseByCode(code, companyId);
+        if (null != list) {
+            return list.get(0);
+        }
+        return null;
+    }
+
 }

+ 8 - 0
applications/sale/sale-server/src/main/resources/application.yml

@@ -46,6 +46,14 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 server:
   port: 8820
   tomcat:

+ 3 - 2
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -41,6 +41,7 @@
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
     <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pd_ordertotal" jdbcType="DOUBLE" property="pd_ordertotal" />
     <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
       <id column="pr_id" property="id"/>
       <result column="pr_code" property="pr_code"/>
@@ -759,14 +760,14 @@ update prodiodetail a
 
   <update id="updatePDSaleIN" parameterType="long">
    update prodiodetail set
-   pd_total=round(IFNULL(pd_inqty,0)*IFNULL(pd_sendprice,0),2),
+   pd_ordertotal=round(IFNULL(pd_inqty,0)*IFNULL(pd_sendprice,0),2),
    pd_netprice = round(IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),2),
    pd_nettotal = round((IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_inqty,0),2)
    where pd_piid=#{id}
   </update>
   <update id="updatePDSaleOut" parameterType="long">
     update prodiodetail set
-    pd_total=round(IFNULL(pd_outqty,0)*IFNULL(pd_sendprice,0),2),
+    pd_ordertotal=round(IFNULL(pd_outqty,0)*IFNULL(pd_sendprice,0),2),
     pd_netprice = round(IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),2),
     pd_nettotal = round((IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_outqty,0),2)
     where pd_piid=#{id}

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

@@ -96,7 +96,7 @@
           and  companyId = #{companyId}
         </if>
       </where>
-      order by pi_id
+      order by pi_id desc
   </select>
 
 </mapper>

+ 5 - 1
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -540,9 +540,13 @@
   </select>
   <update id="updatePiTotal"  parameterType="long">
 update ProdInOut SET
-		 pi_total = ( select IFNULL(sum(IFNULL(pd_total,0)),0) FROM ProdIODetail WHERE pd_piid=#{id}),
+		 pi_total = ( select IFNULL(sum(IFNULL(pd_ordertotal,0)),0) FROM ProdIODetail WHERE pd_piid=#{id}),
 		 pi_nettotal = ( select IFNULL(sum(IFNULL(pd_nettotal,0)),0) FROM ProdIODetail WHERE pd_piid=#{id})
 			where pi_id =#{id}
   </update>
 
+  <select id="getWareHouseByCode" resultType="java.util.HashMap">
+    select pr_whid,pr_whcode,pr_whname from product where pr_code=#{code} and companyid=#{companyId} and pr_statuscode='OPEN'
+  </select>
+
 </mapper>

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

@@ -60,7 +60,7 @@
             <if test="companyId != null">
                 and   sale.companyId = #{companyId}
             </if>
-        </where>  order by sd_detno
+        </where>  order by sd_detno desc
     </select>
 
     <select id="selectPurchaseBycondition" resultMap="BaseResultMap">
@@ -73,7 +73,7 @@
                 and  companyId = #{companyId}
             </if>
         </where>
-        order by sa_id
+        order by sa_id desc
     </select>
 
 </mapper>

+ 9 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -28,12 +28,14 @@
     <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_auditman" property="sa_auditman" jdbcType="VARCHAR" />
+    <result column="sa_auditdate" property="sa_auditdate" jdbcType="TIMESTAMP"/>
   </resultMap>
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyId, updaterId, 
-    updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5
+    updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -303,6 +305,12 @@
       <if test="sa_text5 != null" >
         sa_text5 = #{sa_text5,jdbcType=VARCHAR},
       </if>
+      <if test="sa_auditman != null" >
+        sa_auditman = #{sa_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_auditdate != null" >
+        sa_auditdate = #{sa_auditdate,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where sa_id = #{id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdIODetail.java

@@ -81,6 +81,8 @@ public class ProdIODetail extends CommonBaseEntity implements Serializable {
 
     private Long pd_ioid;
 
+    private Double pd_ordertotal;
+
     private ProductDTO productDTO;
 
 }

+ 8 - 0
applications/storage/storage-server/src/main/resources/application.yml

@@ -48,6 +48,14 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 server:
   port: 9000
   tomcat:

+ 1 - 1
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/AccountCache.java

@@ -38,7 +38,7 @@ public class AccountCache extends RedisHashCache<String, String, String> {
 
     @Override
     protected String key() {
-        return generateKey("account", "account");
+        return generatePublicKey("account", "account");
     }
 
     @Override

+ 1 - 1
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/ResourceCache.java

@@ -40,7 +40,7 @@ public class ResourceCache extends RedisHashCache<String, String, String> {
 
     @Override
     protected String key() {
-        return generateKey("account", "resource");
+        return generatePublicKey("account", "resource");
     }
 
     @Override

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

@@ -50,7 +50,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
   port: 8580
   tomcat:
@@ -63,6 +63,10 @@ management:
   endpoint:
     health:
       show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

+ 2 - 1
base-servers/auth/auth-client/src/main/java/com/usoftchina/saas/auth/client/interceptor/AuthRestInterceptor.java

@@ -44,7 +44,8 @@ public class AuthRestInterceptor extends HandlerInterceptorAdapter {
                 BaseContextHolder.setUserId(infoFromToken.getUserId());
                 BaseContextHolder.setCompanyId(infoFromToken.getCompanyId());
                 BaseContextHolder.setToken(token);
-                log.info("token={} \\r\\n userName={}", token, infoFromToken.getUserName());
+                log.info("request={} token={} \\r\\n userName={}", request.getRequestURI(),
+                        token, infoFromToken.getUserName());
             }
         } else {
             // no mapping

+ 7 - 0
base-servers/auth/auth-server/src/main/resources/application.yml

@@ -35,6 +35,9 @@ spring:
       connection-timeout: 30000
   messages:
     basename: i18n/messages
+  redis:
+    host: 192.168.253.12
+    port: 6379
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10
@@ -60,6 +63,10 @@ management:
   endpoint:
     health:
       show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

+ 21 - 12
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java

@@ -6,6 +6,7 @@ import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.account.dto.UrlResourceDTO;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.gateway.error.PermissionException;
@@ -40,17 +41,26 @@ public class AuthFilter implements GlobalFilter, Ordered {
 
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
-        if (!isIgnore(exchange.getRequest())) {
-            // 鉴别身份信息
-            JwtInfo jwt = getJwtInfoFromHeader(exchange.getRequest());
-            AccountDTO accountDTO = AccountCache.of(jwt.getUserId()).getAccount();
-            if (null == accountDTO) {
-                throw new BizException(ExceptionCode.USER_NOT_EXIST);
+        try {
+            if (!isIgnore(exchange.getRequest())) {
+                // 鉴别身份信息
+                String token = getAuthHeaderToken(exchange.getRequest());
+                JwtInfo jwt = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
+                BaseContextHolder.setAppId(jwt.getAppId());
+                BaseContextHolder.setUserId(jwt.getUserId());
+                BaseContextHolder.setCompanyId(jwt.getCompanyId());
+                BaseContextHolder.setToken(token);
+                AccountDTO accountDTO = AccountCache.of(jwt.getUserId()).getAccount();
+                if (null == accountDTO) {
+                    throw new BizException(ExceptionCode.USER_NOT_EXIST);
+                }
+                // 鉴别角色权限
+                checkPermission(exchange.getRequest(), jwt, accountDTO);
             }
-            // 鉴别角色权限
-            checkPermission(exchange.getRequest(), jwt, accountDTO);
+            return chain.filter(exchange);
+        } finally {
+            BaseContextHolder.remove();
         }
-        return chain.filter(exchange);
     }
 
     /**
@@ -97,7 +107,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
         return authConfig.getIgnores().stream().anyMatch(ignore -> ignore.equals(path));
     }
 
-    private JwtInfo getJwtInfoFromHeader(ServerHttpRequest request) {
+    private String getAuthHeaderToken(ServerHttpRequest request) {
         if (!request.getHeaders().containsKey(authConfig.getAuthHeader())) {
             throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
         }
@@ -105,8 +115,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
         if (headers.isEmpty()) {
             throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
         }
-        String token = headers.get(0).trim();
-        return JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
+        return headers.get(0).trim();
     }
 
     @Override

+ 6 - 0
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/WebConfig.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.gateway.config;
 
+import com.usoftchina.saas.gateway.interceptor.ServiceFeignInterceptor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpHeaders;
@@ -46,4 +47,9 @@ public class WebConfig {
             return chain.filter(ctx);
         };
     }
+	
+	@Bean
+    public ServiceFeignInterceptor serviceFeignInterceptor() {
+        return new ServiceFeignInterceptor();
+    }
 }

+ 28 - 0
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/interceptor/ServiceFeignInterceptor.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.gateway.interceptor;
+
+import com.usoftchina.saas.gateway.config.AuthConfig;
+import com.usoftchina.saas.context.BaseContextHolder;
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author yingp
+ * @date 2018/10/2
+ */
+public class ServiceFeignInterceptor implements RequestInterceptor {
+    @Autowired
+    private AuthConfig authConfig;
+
+    public ServiceFeignInterceptor() {
+    }
+
+    @Override
+    public void apply(RequestTemplate requestTemplate) {
+        requestTemplate.header(authConfig.getAuthHeader(), BaseContextHolder.getToken());
+    }
+
+    public void setAuthConfig(AuthConfig authConfig) {
+        this.authConfig = authConfig;
+    }
+}

+ 4 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -132,6 +132,10 @@ management:
   endpoint:
     health:
       show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 feign:
   hystrix:
     enabled: true

+ 4 - 0
base-servers/ui-server/src/main/resources/application.yml

@@ -50,6 +50,10 @@ management:
   endpoint:
     health:
       show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

+ 16 - 2
framework/core/src/main/java/com/usoftchina/saas/cache/BaseRedisCache.java

@@ -101,17 +101,31 @@ public abstract class BaseRedisCache<K, V> implements Cache<V> {
     }
 
     /**
-     * 产生key
+     * 产生key (每个应用会不一样)
      * 规则:[env profile]:[application name]:[business key]
      *
      * @param values
      * @return
      */
-    protected String generateKey(CharSequence... values) {
+    protected String generatePrivateKey(CharSequence... values) {
         return new StringJoiner(":")
                 .add(SpringContextHolder.getActiveProfile())
                 .add(SpringContextHolder.getApplicationName())
                 .add(String.join(":", values))
                 .toString();
     }
+
+    /**
+     * 产生key (所有应用一样)
+     * 规则:[env profile]:[business key]
+     *
+     * @param values
+     * @return
+     */
+    protected String generatePublicKey(CharSequence... values) {
+        return new StringJoiner(":")
+                .add(SpringContextHolder.getActiveProfile())
+                .add(String.join(":", values))
+                .toString();
+    }
 }

+ 1 - 0
frontend/saas-web/app/model/sale/ProdIODetail.js

@@ -35,6 +35,7 @@ Ext.define('saas.model.sale.ProdIODetail', {
         { name: 'pd_yqty', type: 'int' },
         { name: 'pd_remark', type: 'string' },
         { name: 'pd_ioid', type: 'int' },
+        { name: 'pd_ordertotal', type: 'float' }
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]

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

@@ -114,7 +114,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                             //点开放大镜的行
                             var mainGrid = grid.dbfindtrigger.column.ownerCt.ownerCt;
                             var rec = mainGrid.selModel.getLastSelected();
-                            Ext.Array.each(selectRecordArr,function(record,index) {
+                            Ext.Array.each(selectRecordArr,function(record,_index) {
                                 Ext.Array.each(dbfinds,function(dbfind) {
                                     if(rec){
                                         var nowRec = mainGrid.store.getData().getByKey(rec.id);
@@ -125,7 +125,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                                     return f.id==(rec&&rec.id?rec.id:0)
                                 });
                                 rec = mainGrid.store.data.getAt(index+1);
-                                if(!rec&&index!=selectRecordArr.length-1){//添加下一行
+                                if(!rec&&_index!=selectRecordArr.length-1){//添加下一行
                                     var data = {};
                                     data[mainGrid.ownerCt.detnoColumn] = index + 2;
                                     mainGrid.store.insert(index+1, data);

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

@@ -34,7 +34,6 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     		var sfield='';
             var dbfinds=me.dbfinds;
             var dbtpls=me.dbtpls;
-            var dbCondition = me.dbCondition.replace(new RegExp("\\{0}","g"), queryString);
     		me.lastQueryValue=queryString;
             if(queryString.trim()==''){
                 me.collapse( );
@@ -50,7 +49,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                             if(i==0){
                                 span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';//display:block;
                             }else{
-                                span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
+                                span=span+'<span style="padding:0 0 0 20px;width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
                             }
                             if(dbtpls[i].dbField=="true"){
                                 me.searchFieldArray=dbtpls[i].field;
@@ -75,12 +74,41 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     }
                 }
                 //加载数据
-                var data;
+                var data,dbCondition=[];
+                if(me.dbfinds){
+                    var dbtplcondition = "";
+                    for (let index = 0; index < dbfinds.length; index++) {
+                        var item = dbfinds[index].from;
+                        if(!dbfinds[index].ignore){
+                            dbtplcondition+= "upper("+item+") like '%"+queryString.toUpperCase()+"%' or ";
+                        }
+                    }
+                    dbtplcondition = "(" + dbtplcondition.substring(0,dbtplcondition.length-4) + ")";
+                    if(dbtplcondition.length>0){
+                        dbCondition = [{
+                            type: 'condition',
+                            value:dbtplcondition
+                        }];
+                    }
+                }
+                //添加默认条件
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
                 Ext.Ajax.request({
                     url: me.dataUrl,
                     params: {
-                        keyword:dbCondition
+                        number: 1,
+                        size: 10,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
                     },
+                    method: 'GET',
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = data.data.list;
@@ -88,7 +116,8 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                             me.store.loadData(data,false);
                             me.expand();
                         }else{
-                            me.collapse( );
+                            me.store.removeAll();
+                            me.collapse();
                         }
                     },
                     failure: function(response, opts) {}
@@ -138,6 +167,70 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     },
 
     listeners: {
+        blur:function(f,e){
+            var me = f;
+            var count = f.store.getCount();
+            var dbfinds = me.dbfinds;
+            // if(count==1){
+            //     record = f.store.data.items[0];
+            //     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,record.get(item.from));
+            //                 if(me.name==item.to){
+            //                     me.column.getEditor().setValue(record.get(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 = record.get(item.from);
+            //                     if(field.xtype=='dbfindtrigger'){
+            //                         field.setRawValue(val);
+            //                         field.value = val;
+            //                         field.lastTriggerValue=val;
+            //                     }else{
+            //                         field.setValue(val);
+            //                     }    
+            //                 }
+            //             }
+            //         }
+            //     }
+            // }else 
+            if(!f.value||f.value==''){
+                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,'');
+                            if(me.name==item.to){
+                                me.column.getEditor().setValue('');
+                            }
+                        }
+                    }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){
+                                if(field.xtype=='dbfindtrigger'){
+                                    field.setValue(null);
+                                    field.lastTriggerValue=null;
+                                }else{
+                                    field.setValue(null);
+                                }    
+                            }
+                        }
+                    }
+                }
+            }
+        },
         select:function(combo,record,eOpts){
             var me = combo;
             var dbfinds = me.dbfinds;

+ 24 - 15
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -28,21 +28,25 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var id = viewModel.get(form._idField);
         var code = viewModel.get(form._codeField);
         if(id&&id.value!=0){
-            me.BaseUtil.request({
-                url: form._deleteUrl+id,
-                method: 'POST',
-            })
-            .then(function(localJson) {
-                if(localJson.success){
-                    var mainTab = Ext.getCmp('main-tab-panel');
-                    mainTab.getActiveTab().close();
-                    //解析参数
-                    showToast('删除成功');
+            deleteWarn(form._deleteMsg,function(btn){
+                if(btn == 'yes'){
+                    me.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            var mainTab = Ext.getCmp('main-tab-panel');
+                            mainTab.getActiveTab().close();
+                            //解析参数
+                            showToast('删除成功');
+                        }
+                    })
+                    .catch(function(res) {
+                        console.error(res);
+                        showToast('删除失败: ' + res.message);
+                    });
                 }
-            })
-            .catch(function(res) {
-                console.error(res);
-                showToast('删除失败: ' + res.message);
             });
         }
     },
@@ -101,11 +105,14 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 var newTitle = form._title + '(' + code + ')';
 
                 refreshTabTitle(newId, newTitle);
+
+                form.fireEvent('aftersave', true, form, localJson);
             }
         })
         .catch(function(res) {
             console.error(res);
             showToast('保存失败: ' + res.message);
+            form.fireEvent('aftersave', false, form, res);
         });
     },
 
@@ -160,7 +167,8 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 }
                 form.FormUtil.loadData(form);
                 form.setEditable(false);
-                showToast('审核成功');
+                showToast('审核成功' + (localJson.message ? ': ' + localJson.message : ''));
+                form.fireEvent('afteraudit', true, form, localJson);
             }
         })
         .catch(function(res) {
@@ -178,6 +186,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 form.FormUtil.loadData(form);
             }
             showToast('审核失败: ' + res.message);
+            form.fireEvent('afteraudit', false, form, res);
         });
     },
     unAudit: function() {

+ 2 - 0
frontend/saas-web/app/view/core/tab/Controller.js

@@ -6,9 +6,11 @@ Ext.define('saas.view.core.tab.Controller', {
         var me = this,
         tab = me.getView(),
         viewType = tab.viewType,
+        _config = tab.index,
         viewConfig = tab.viewConfig;
 
         var view = {
+            _config : viewConfig,
             xtype: viewType
         };
         Ext.apply(view, viewConfig);

+ 57 - 27
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -41,7 +41,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank: true,
         columnWidth: 0.25
     },{
-        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
@@ -90,34 +89,62 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name : "cu_beginaramount", 
         fieldLabel : "期初应收", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_beginprerecamount", 
         fieldLabel : "期初预收", 
         allowBlank : true, 
-        columnWidth : 0.25    
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },   
     },{
         xtype : "numberfield", 
         name : "cu_taxrate", 
         fieldLabel : "税率", 
         allowBlank : false, 
-        columnWidth : 0.25   
+        columnWidth : 0.25,
+        minValue:0,
+        maxValue:100,
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_promisedays", 
         fieldLabel : "承付天数", 
         allowBlank : true, 
-        columnWidth : 0.25        
+        columnWidth : 0.25,
+        decimalPrecision:0,
+        minValue:0
     },{
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_credit", 
         fieldLabel : "额度", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         xtype : "textfield", 
         name : "cu_sellername", 
@@ -128,30 +155,24 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_1", 
-        fieldLabel : "纳税人识别号", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden", 
+        name : "cu_nsrzh", 
+        fieldLabel : "纳税人识别号", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_2", 
-        fieldLabel : "开户银行", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden", 
+        name : "cu_bankaccount", 
+        fieldLabel : "开户银行", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        xtype : "textfield", 
-        name : "cu_3", 
-        fieldLabel : "银行账户", 
         ignore:true,
-        editable:false,
-        readOnly:true,
+        xtype : "hidden",  
+        name : "cu_bankcode", 
+        fieldLabel : "银行账户", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
@@ -159,6 +180,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name : "cu_uu", 
         fieldLabel : "客户UU", 
         allowBlank : true, 
+        readOnly:true,
+        editable:false,
         columnWidth : 0.25
     },{
         xtype:'textfield',
@@ -167,7 +190,15 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         readOnly:true,
         ignore:true,
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         xtype : "datefield", 
         name : "createTime", 
@@ -224,7 +255,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null
             },
             {
-                allowBlank:false,
+                allowBlank:true,
                 text : "微信/QQ", 
                 editor : {
                     xtype : "textfield"
@@ -245,7 +276,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
             {
                 editor : {
                     displayField : "display", 
-                    editable:false,
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 
@@ -320,7 +350,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null
             },  
             {
-                allowBlank:false,
+                allowBlank:true,
                 text : "联系人", 
                 editor : {
                     xtype : "textfield"
@@ -330,7 +360,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null   
             },
             {
-                allowBlank:false,
+                allowBlank:true,
                 text : "联系电话", 
                 editor : {
                     xtype : "textfield",
@@ -341,8 +371,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null   
             },
             {
+                allowBlank:false,
                 editor : {
-                    editable:false,
                     displayField : "display", 
                     format : "", 
                     hideTrigger : false, 

+ 27 - 2
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -100,7 +100,11 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 readOnly:true,
                 fieldLabel:'建账日期',
                 format:'Y-m-d H:i:s',
-                value:new Date()
+                listeners:{
+                    beforerender:function(d){
+                        d.setValue(new Date())
+                    }
+                }
             }]
         },
         productbrand:{
@@ -135,8 +139,29 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 name:'ft_name',
                 allowBlank:false,
-                fieldLabel:'类型',
+                fieldLabel:'收支名称',
                 maxLength: 20
+            },{
+                xtype:'combo',
+                name:'ft_kind',
+                allowBlank:false,
+                fieldLabel:'收支类型',
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                xtype : "combo",
+                editable:false,
+                displayField : "display", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"收入", "value":'收入'},
+                        {"display":"支出", "value":'支出'}
+                    ]
+                }
             }]
         },
         address:{

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

@@ -21,6 +21,7 @@ Ext.define('saas.view.document.kind.Kind', {
         xtype: 'segmentedbutton',
         reference: 'dataKind',
         value: 'customerkind',
+        name : 'segmentedbutton',
         bind:'{segmented}',
         items: [{
             text: '客户',
@@ -154,9 +155,13 @@ Ext.define('saas.view.document.kind.Kind', {
         },
         inoutkind:{
             columns: [{
-                text: '收支类别',
+                text: '收支名称',
                 dataIndex: 'ft_name',
                 flex: 1
+            },{
+                text: '收支类别',
+                dataIndex: 'ft_kind',
+                flex: 1
             }],
             keyField:'id',
             reqUrl: '/api/document/fundinouttype/save',
@@ -262,6 +267,8 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl: '/api/document/warehouse/save',
             delUrl: '/api/document/warehouse/delete'
         }
+    },
+    refresh:function(){
     }
 })
 

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

@@ -15,6 +15,10 @@ Ext.define('saas.view.document.kind.KindController', {
         }else{
             defaultKind=vm.getData()['dataKind'].value  //类别合并界面
         }
+        if(grid.ownerCt._config){
+            defaultKind = grid.ownerCt._config;
+            vm.setData({'dataKind':{'value':grid.ownerCt._config}});
+        }
         var etc = view.etc[defaultKind];
         var store = vm.getStore(defaultKind);
         store.load();

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

@@ -152,7 +152,7 @@ Ext.define('saas.view.document.kind.KindModel', {
         inoutkind:{ 
             fields:[
                 {name: 'id', type: 'int'},
-                {name: 'ft_type',  type: 'string'},
+                {name: 'ft_kind',  type: 'string'},
                 {name: 'ft_name',  type: 'string'}
             ],
             proxy: {  

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

@@ -12,6 +12,8 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/vendor/getVendorsByCondition',
                         //赋值 
                         dbfinds:[{
+                            from:'id',to:'pr_vendid'
+                        },{
                             from:'ve_code',to:'pr_vendcode'
                         },{
                             from:'ve_name',to:'pr_vendname'
@@ -41,7 +43,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dbColumns:[{
                             "text": "供应商ID",
                             "flex": 0,
-                            "dataIndex": "ve_id",
+                            "dataIndex": "id",
                             "width": 0,
                             "xtype": "",
                         },{
@@ -74,6 +76,8 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/warehouse/list',
                         //放大镜赋值设置
                         dbfinds:[{
+                            from:'id',to:'pr_whid',ignore:true
+                        },{
                             from:'wh_code',to:'pr_whcode'
                         },{
                             from:'wh_description',to:'pr_whname'
@@ -105,7 +109,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dbColumns:[{
                             "text": "ID",
                             "flex": 0,
-                            "dataIndex": "wh_id",
+                            "dataIndex": "id",
                             "width": 0,
                             "xtype": "",
                         },{

+ 60 - 37
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -18,6 +18,7 @@ Ext.define('saas.view.document.product.FormPanel', {
     _openUrl:'/api/document/product/open',
     _closeUrl:'/api/document/product/close',
     _deleteUrl:'/api/document/product/delete/',
+    _deleteMsg:'删除的物料将不能恢复,请确认是否删除?',
     initId:0,
 
     codeInHeader: false,
@@ -59,24 +60,25 @@ Ext.define('saas.view.document.product.FormPanel', {
         fieldLabel: '规格',
         allowBlank: false,
         columnWidth: 0.25
-    },{
+    },{  
         editable:false,
         xtype : "remotecombo", 
-        storeUrl:'/api/document/producttype/getCombo',
-        name : "pr_kind", 
-        fieldLabel : "物料类型", 
+        storeUrl:'/api/document/productunit/getCombo',
+        name : "pr_unit", 
+        fieldLabel : "单位", 
         allowBlank : false, 
         columnWidth : 0.25,
+        editable:false,
         addHandler:function(b){
             var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 bind: {
-                    title: '新增物料类型'
+                    title: '新增物料单位'
                 },
-                dataKind:'productkind',
-                belong:document.etc['productkind'],
+                dataKind:'productunit',
+                belong:document.etc['productunit'],
                 _parent:form,
                 _combo:this.ownerCmp,
                 record:null,
@@ -85,30 +87,37 @@ Ext.define('saas.view.document.product.FormPanel', {
             this.dialog.show();
         }
     },{
-        xtype: 'textfield',
-        name: 'pr_orispeccode',
-        fieldLabel: '型号',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{  
+        xtype : "dbfindtrigger",   
+        name : "pr_vendcode", 
+        bind : "{pr_vendcode}", 
+        fieldLabel : "供应商编号", 
+        allowBlank : true, 
+        columnWidth : 0.25, 
+    }, {
+        xtype : "textfield", 
+        name : "pr_vendname", 
+        bind : "{pr_vendname}", 
+        fieldLabel : "供应商名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
         editable:false,
         xtype : "remotecombo", 
-        storeUrl:'/api/document/productunit/getCombo',
-        name : "pr_unit", 
-        fieldLabel : "物料单位", 
+        storeUrl:'/api/document/producttype/getCombo',
+        name : "pr_kind", 
+        fieldLabel : "类型", 
         allowBlank : false, 
         columnWidth : 0.25,
-        editable:false,
         addHandler:function(b){
             var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 bind: {
-                    title: '新增物料单位'
+                    title: '新增物料类型'
                 },
-                dataKind:'productunit',
-                belong:document.etc['productunit'],
+                dataKind:'productkind',
+                belong:document.etc['productkind'],
                 _parent:form,
                 _combo:this.ownerCmp,
                 record:null,
@@ -116,6 +125,12 @@ Ext.define('saas.view.document.product.FormPanel', {
             });
             this.dialog.show();
         }
+    },{
+        xtype: 'textfield',
+        name: 'pr_orispeccode',
+        fieldLabel: '型号',
+        allowBlank: true,
+        columnWidth: 0.25
     },{
         editable:false,
         xtype : "remotecombo", 
@@ -142,25 +157,25 @@ Ext.define('saas.view.document.product.FormPanel', {
             this.dialog.show();
         }
     },{
-        xtype : "dbfindtrigger",   
-        name : "pr_vendcode", 
-        bind : "{pr_vendcode}", 
-        fieldLabel : "供应商编号", 
+        xtype : "hidden", 
+        name : "pr_vendid", 
+        bind : "{pr_vendid}", 
+        fieldLabel : "供应商ID", 
         allowBlank : true, 
-        columnWidth : 0.25, 
-    }, {
-        xtype : "textfield", 
-        name : "pr_vendname", 
-        bind : "{pr_vendname}", 
-        fieldLabel : "供应商名称", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0
     },{
-        xtype : "dbfindtrigger",   
+        xtype : "hidden", 
+        name : "pr_whid", 
+        bind : "{pr_whid}", 
+        fieldLabel : "仓库ID", 
+        allowBlank : true, 
+        columnWidth : 0
+    },{  
+        xtype : "dbfindtrigger",     
         name : "pr_whcode", 
         bind : "{pr_whcode}", 
         fieldLabel : "仓库编号", 
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25, 
     }, {
         xtype : "textfield", 
@@ -169,17 +184,25 @@ Ext.define('saas.view.document.product.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        ignore:true,
-        readOnly:true,
         xtype : "numberfield", 
+        bind : "{pr_standardprice}",
         name : "pr_standardprice", 
         fieldLabel : "标准单价", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{
         ignore:true,
         readOnly:true,
         xtype : "numberfield", 
+        bind : "{pr_purcprice}",
         name : "pr_purcprice", 
         fieldLabel : "最新采购单价", 
         allowBlank : true, 

+ 42 - 21
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -95,55 +95,66 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         xtype : "numberfield", 
         hideTrigger:true,
         name : "ve_beginapamount", 
-        fieldLabel : "期初应", 
+        fieldLabel : "期初应", 
         allowBlank : true, 
-        columnWidth : 0.25
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
     },{ 
         xtype : "numberfield", 
         hideTrigger:true, 
         name : "ve_beginprepayamount", 
-        fieldLabel : "期初预收", 
+        fieldLabel : "期初预", 
         allowBlank : true, 
-        columnWidth : 0.25    
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },    
     },{
         xtype : "numberfield", 
         name : "ve_taxrate", 
         hideTrigger:true,
         fieldLabel : "税率", 
         allowBlank : false, 
-        columnWidth : 0.25   
+        columnWidth : 0.25,
+        minValue:0,  
+        maxValue:100,
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "ve_promisedays", 
         fieldLabel : "承付天数", 
         allowBlank : true, 
-        columnWidth : 0.25      
+        columnWidth : 0.25,
+        minValue:0,
+        decimalPrecision: 0, 
     },{
         xtype : "textfield", 
-        name : "ve_1", 
+        name : "ve_nsrzh", 
         fieldLabel : "纳税人识别号", 
-        ignore:true,
-        editable:false,
-        readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "textfield", 
-        name : "ve_2", 
+        name : "ve_bankcode", 
         fieldLabel : "开户银行", 
-        ignore:true,
-        editable:false,
-        readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "textfield", 
-        name : "ve_3", 
+        name : "ve_bankaccount", 
         fieldLabel : "银行账户", 
-        ignore:true,
-        editable:false,
-        readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     },{
@@ -151,6 +162,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         name : "ve_uu", 
         fieldLabel : "供应商UU", 
         allowBlank : true, 
+        editable:false,
+        readOnly:true,
         columnWidth : 0.25
     },{  
         xtype : "datefield", 
@@ -166,7 +179,15 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank : true, 
         readOnly:true,
         ignore:true,
-        columnWidth : 0.25  
+        columnWidth : 0.25,
+        decimalPrecision: 8,
+        minValue:0,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },  
     }, {
         xtype : "detailGridField", 
         storeModel:'saas.model.document.vendorcontact',
@@ -206,7 +227,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 xtype : "", 
             },
             {
-                allowBlank:false,
+                allowBlank:true,
                 text : "微信/QQ", 
                 editor : {
                     xtype : "textfield"
@@ -225,7 +246,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             {
                 editor : {
                     displayField : "display", 
-                    editable:false,
+                    editable:true,
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 

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

@@ -83,7 +83,7 @@ Ext.define('saas.view.main.Navigation', {
                     '<div class="menu-content">',
                     '<tpl for="items">',
                     '<div class="menuitem">',
-                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
+                    '<div class="item-text" title="{text}" data-config="{config}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
                     '{text}',
                     '</div>',
                     '<tpl if="{addType}">',
@@ -142,13 +142,14 @@ Ext.define('saas.view.main.Navigation', {
                                     viewType = dataset.viewtype,
                                     type = dataset.type,
                                     text = dataset.text,
+                                    config = dataset.config,
                                     id = dataset.id;
 
                                     var tabTitle = text + '查询',
                                     tabId = 'maintab-' + type + '-' + id;
 
                                     menu.navItem.classList.remove(menu.navView.overItemCls);
-                                    openTab(viewType, tabTitle, tabId);
+                                    openTab(viewType, tabTitle, tabId,config);
                                     menu.hide();
                                 });
                             });

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

@@ -9,7 +9,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
     caller:'FundTransfer',
     
      //字段属性
-     _title:'其它收入单',
+     _title:'资金转账',
      _idField: 'id',
      _codeField: 'ft_code',
      _statusField: 'ft_status',
@@ -51,7 +51,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                     xtype : "numberfield"
                 },
                 width : 120.0, 
-                xtype : "numbercolumn", 
+                xtype : "hidden",
                 items : null
             }, {
                 text : "转出账户ID", 

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

@@ -68,8 +68,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             "width": 120,
                             "xtype": "datecolumn"
                         }]
-                    }) ;   
-
+                    }) ;
                 }
             },
             'dbfindtrigger[name=ftd_inbankname]':{

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

@@ -24,7 +24,7 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
             text: 'id',
             dataIndex: 'id',
             width: 0,
-            xtype: 'numbercolumn'
+            xtype: 'hidden'
         }, {
             text: '单据编号',
             dataIndex: 'ft_code',

+ 4 - 5
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -75,12 +75,11 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
             }, {
                 text : "收入类别", 
                 width : 200.0, 
-                dataIndex : "ord_type", 
-                xtype : "", 
+                dataIndex : "ord_type",
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:'/api/document/inoutkind/getCombo',
+                    storeUrl:'/api/document/fundinouttype/getCombo',
                     addHandler:function(b){
                         var document = Ext.create('saas.view.document.kind.Kind',{});
                         var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
@@ -89,8 +88,8 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                             bind: {
                                 title: '新增收入类别类型'
                             },
-                            dataKind:'inoutkind',
-                            belong:document.etc['inoutkind'],
+                            dataKind:'fundinouttype',
+                            belong:document.etc['fundinouttype'],
                             _parent:form,
                             _combo:this.ownerCmp,
                             record:null,

+ 1 - 1
frontend/saas-web/app/view/money/othreceipts/QueryPanel.js

@@ -49,7 +49,7 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

+ 15 - 9
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -35,7 +35,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
          name : 'os_vendcode', 
          fieldLabel : '供应商编号'
      }, {
-         xtype : "dbfindtrigger", 
+         xtype : "dbfindtrigger",
          name : "os_vendname", 
          fieldLabel : "供应商名称"
      }, {
@@ -47,10 +47,18 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
          name : 'os_bankcode', 
          fieldLabel : '结算账户编号'
      }, {
-         xtype : "dbfindtrigger", 
+         xtype : "dbfindtrigger",
          name : "os_bankname", 
          fieldLabel : "结算账户名称"
      }, {
+        xtype:'datefield',
+        name : 'os_date',
+        fieldLabel : '单据日期'
+    },{
+        xtype : 'numberfield',
+        name : 'os_amount',
+        fieldLabel : '付款金额'
+    },{
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.money.Othspendings',
@@ -70,17 +78,16 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                     xtype : "numberfield"
                 },
                 width : 120.0, 
-                xtype : "numbercolumn", 
+                xtype : "hidden",
                 items : null
             }, {
                 text : "支出类别", 
                 width : 200.0, 
-                dataIndex : "osd_type", 
-                xtype : "", 
+                dataIndex : "osd_type",
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:'/api/document/inoutkind/getCombo',
+                    storeUrl:'/api/document/fundinouttype/getCombo',
                     addHandler:function(b){
                         var document = Ext.create('saas.view.document.kind.Kind',{});
                         var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
@@ -89,8 +96,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                             bind: {
                                 title: '新增收入类别类型'
                             },
-                            dataKind:'inoutkind',
-                            belong:document.etc['inoutkind'],
+                            dataKind:'fundinouttype',
+                            belong:document.etc['fundinouttype'],
                             _parent:form,
                             _combo:this.ownerCmp,
                             record:null,
@@ -151,6 +158,5 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
         fieldLabel : "录入日期",
         readOnly:true
     }
-
     ]
 });

+ 1 - 1
frontend/saas-web/app/view/money/othspendings/QueryPanel.js

@@ -49,7 +49,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

+ 66 - 24
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -61,10 +61,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         xtype: "datefield",
         name: "pb_date",
         fieldLabel: "日期"
-    },{
-      xtype:"textfield",
-      name:"pb_code",
-      fieldLabel:"单号"
     },{
         xtype: 'hidden',
         name: 'pb_manname',
@@ -110,15 +106,38 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         }, {
             text: '结算账户ID',
             dataIndex: 'pd_bankid',
-            editor:{
-                xtype:'hidden'
-            }
+            xtype:'hidden'
         }, {
         //     text: '结算账户编号',
         //     dataIndex: 'paybalancedet'
         // }, {
             text: '资金账户',
-            dataIndex: 'pd_bankname'
+            dataIndex: 'pd_bankname',
+            editable:false,
+            // xtype : "remotecombo",
+            // storeUrl:'/api/document/bankinformation/getCombo',
+            // name : "bk_bankname",
+            // fieldLabel : "资金账户",
+            // allowBlank : false, //不能为空
+            // columnWidth : 0.25,//布局
+            // hiddenBtn:false,//true 则会关闭新增按钮功能
+            // addHandler:function(b){
+            //     var document = Ext.create('saas.view.document.kind.Kind',{});
+            //     var form = this.ownerCmp.ownerCt;
+            //     this.dialog = form.getController().getView().add({
+            //         xtype: 'document-kind-childwin',
+            //         bind: {
+            //             title: '新增资金账户'
+            //         },
+            //         dataKind:'bankinformation',
+            //         belong:document.etc['bankinformation'],
+            //         _parent:form,
+            //         _combo:this.ownerCmp,
+            //         record:null,
+            //         session: true
+            //     });
+            //     this.dialog.show();
+            // }
         }, {
             text: "付款金额",
             dataIndex: "pd_amount",
@@ -141,10 +160,27 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             }
         }, {
             text: "结算方式",
-            dataIndex: "pd_paymethod"
+            dataIndex: "pd_paymethod",
+            editor : {
+                xtype:'combo',
+                queryMode: 'local',
+                displayField: 'display',
+                valueField: 'value',
+                store:Ext.create('Ext.data.Store', {
+                    fields: ['value', 'display'],
+                    data : [{value:"信用卡", display:"信用卡"},
+                        {value:"支票", display:"支票"},
+                        {value:"汇票", display:"汇票"},
+                        {value:"现金", display:"现金"},
+                        {value:"银行转账", display:"银行转账"}]
+                })
+            }
         }, {
             text: "结算号",
-            dataIndex: "pd_paycode"
+            dataIndex: "pd_paycode",
+            editor:{
+                xtype:'textfield'
+            }
         }, {
             text: "备注",
             dataIndex: "pd_remark",
@@ -154,36 +190,44 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             }
         }]
     }, {
+        xtype:'button',
+        text:'选择源单',
+        width:100
+
+    },{
         xtype: "detailGridField",
         storeModel: 'saas.model.money.PayBalance2',
         detnoColumn: 'pbd_detno',
         deleteDetailUrl: '/api/money/paybalance/deleteDetail2/',
-        ltar: {
-          xtype:'button',
-          text:'选择源单',
-          name:'chooseSource'
-        },columns: [{
+        columns: [{
             text: 'ID',
             dataIndex: 'id',
             hidden: true
         }, {
             text: '期间',
             dataIndex: 'pbd_ym',
-            editor:{
-                xtype:'hidden'
-            }
+            xtype:'hidden'
         }, {
             text: '来源ID',
             dataIndex: 'pbd_slid',
-            editor:{
-                xtype:'hidden'
-            }
+            xtype:'hidden'
         }, {
             text: '来源单号',
             dataIndex: 'pbd_slcode'
         }, {
             text: "业务类型",
             dataIndex: "pbd_slkind",
+            editor : {
+                xtype:'combo',
+                queryMode: 'local',
+                displayField: 'display',
+                valueField: 'value',
+                store:Ext.create('Ext.data.Store', {
+                    fields: ['value', 'display'],
+                    data : [{value:"应付", display:"应付"},
+                        {value:"应收", display:"应收"}]
+                })
+            }
         }, {
             text: "单据日期",
             dataIndex: "pbd_sldate",
@@ -273,9 +317,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             text: '备注',
             dataIndex: 'pbd_remark',
             width: 250,
-            editor:{
-                xtype: 'hidden'
-            }
+            xtype: 'hidden'
         }]
     }, {
         xtype: 'hidden',

+ 4 - 1
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -9,7 +9,7 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
             'dbfindtrigger[name=pb_vendname]':{
                 beforerender: function (f) {
                     Ext.apply(f, {
-                        dataUrl: 'api/document/vendor/list',
+                        dataUrl: '/api/document/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds: [{
@@ -18,6 +18,9 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                         }, {
                             from: 've_name',
                             to: 'pb_vendname'
+                        },{
+                            from: 've_leftamount',
+                            to: 've_leftamount'
                         }],
                         dbtpls: [{
                             field: 've_code',

+ 3 - 3
frontend/saas-web/app/view/money/payBalance/QueryPanel.js

@@ -18,9 +18,9 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         codeField: 'pb_code',
         addTitle: '付款单',
         addXtype: 'money-paybalance-formpanel',
-        defaultCondition:'',
+        defaultCondition:'1=1',
         baseVastUrl: '/api/money/paybalance/',
-        // baseVastUrl: 'http://192.168.253.129:8940/money/paybalance/',
+        // baseVastUrl: 'http://127.0.0.1:8880/paybalance/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
@@ -38,7 +38,7 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         }, {
             text: '日期',
             dataIndex: 'pb_date',
-            width: 120
+            width: 160
         }, {
             text: '供应商编号',
             dataIndex: 'pb_vendcode',

+ 25 - 36
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -32,7 +32,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         name: 'rb_custid',
         fieldLabel: '客户ID'
     }, {
-        xtype: 'hidden',
+        xtype: 'textfield',
         name: 'rb_kind',
         fieldLabel: '单据类型',
         defaultValue: '收款单'
@@ -89,9 +89,9 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         }, {
             text: '期间',
             dataIndex: 'rd_ym',
-            editor: {
-                xtype: 'numberfield'
-            },
+            // editor: {
+            //     xtype: 'numberfield'
+            // },
             hidden: true
         }, {
             text: '资金账户ID',
@@ -139,8 +139,19 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         }, {
             text: "结算方式",
             dataIndex: "rd_paymethod",
-            editor: {
-                xtype: 'textfield'
+            editor : {
+                xtype:'combo',
+                queryMode: 'local',
+                displayField: 'display',
+                valueField: 'value',
+                store:Ext.create('Ext.data.Store', {
+                    fields: ['value', 'display'],
+                    data : [{value:"信用卡", display:"信用卡"},
+                        {value:"支票", display:"支票"},
+                        {value:"汇票", display:"汇票"},
+                        {value:"现金", display:"现金"},
+                        {value:"银行转账", display:"银行转账"}]
+                })
             }
         }, {
             text: "结算号",
@@ -157,6 +168,11 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             }
         }]
     }, {
+        xtype:'button',
+        text:'选择源单',
+        width:100
+
+    },{
         xtype: "detailGridField",
         storeModel: 'saas.model.money.RecBalance2',
         detnoColumn: 'rbd_detno',
@@ -181,29 +197,16 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             hidden: true
         }, {
             text: '来源单号',
-            dataIndex: 'rbd_slcode',
-            editor: {
-                xtype: 'textfield'
-            }
+            dataIndex: 'rbd_slcode'
         }, {
             text: "业务类型",
-            dataIndex: "rbd_slkind",
-            editor: {
-                xtype: 'textfield'
-            }
+            dataIndex: "rbd_slkind"
         }, {
             text: "单据日期",
-            dataIndex: "rbd_sldate",
-            editor: {
-                xtype: 'datefield'
-            }
+            dataIndex: "rbd_sldate"
         }, {
             text: "单据金额",
             dataIndex: "rbd_amount",
-            // editor : {
-            //     xtype : "numberfield",
-            //     decimalPrecision: 2
-            // },
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length)).fill('0');
@@ -220,10 +223,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         }, {
             text: "已核销金额",
             dataIndex: "rbd_nowbalance",
-            // editor : {
-            //     xtype : "numberfield",
-            //     decimalPrecision: 2
-            // },
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length)).fill('0');
@@ -240,10 +239,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         }, {
             text: "未核销金额",
             dataIndex: "pbd_nowbalance",
-            // editor : {
-            //     xtype : "numberfield",
-            //     decimalPrecision: 2
-            // },
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length)).fill('0');
@@ -277,12 +272,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
             }
-        // }, {
-        //     text: '备注',
-        //     dataIndex: 'rbd_remark',
-        //     editor: {
-        //         xtype: 'textfield'
-        //     }
         }]
     }, {
         xtype: 'numberfield',

+ 8 - 0
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -19,12 +19,16 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from:'cu_code', to:'rb_custcode'
                         },{
                             from:'cu_name', to:'rb_custname'
+                        },{
+                            from:'cu_leftamount', to:'rb_rdamount'
                         }],
                         //联想设置
                         dbtpls:[{
                             field:'cu_code',width:100
                         },{
                             field:'cu_name',width:100
+                        },{
+                            field:'cu_leftamount',width:100
                         }],
                         defaultCondition: 'cu_statuscode="OPEN"',
                         dbSearchFields:[{
@@ -58,6 +62,10 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             "text": "业务员",
                             "dataIndex": "cu_sellername",
                             "width": 100
+                        },{
+                            "text": "应收款余额",
+                            "dataIndex": "cu_leftamount",
+                            "width": 100
                         },{
                             "text": "税率",
                             "dataIndex": "cu_taxrate",

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

@@ -63,22 +63,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         xtype : "hidden", 
         name : "pu_delivery", 
         fieldLabel : "交货日期"
-    }, {
-        xtype : "hidden", 
-        name : "pu_buyerid", 
-        bind : "{pu_buyerid}", 
-        fieldLabel : "采购员ID"
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyercode", 
-        fieldLabel : "采购员编号", 
-        hidden:true,
-        columnWidth : 0
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyername", 
-        fieldLabel : "采购员名称"
-    }, {
+    },{
         xtype : "textfield", 
         name : "pu_shipaddresscode", 
         fieldLabel : "交货地址"
@@ -172,7 +157,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 8
+                    decimalPrecision: 8,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -202,13 +188,6 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     var xr = (new Array(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)).fill('0');
-                    var format = '0,000.' + xr.join();
-                    return Ext.util.Format.number(v, format);
                 }
             }, 
             {
@@ -228,7 +207,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 width : 120.0, 
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -245,12 +225,13 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 }
             }, 
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "pd_taxtotal", 
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

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

@@ -118,6 +118,8 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             from:'pr_detail',to:'pr_detail'
                         },{
                             from:'pr_spec',to:'pr_spec'
+                        },{
+                            from:'pr_purcprice',to:'pd_price'
                         }],
                         //联想设置
                         dbtpls:[{
@@ -156,8 +158,12 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
+                        }, {
+                            "text": "最新采购单价",
+                            "dataIndex": "pr_purcprice",
+                            "width": 0,
                         },{
                             "text": "仓库id",
                             "dataIndex": "pr_whid",

+ 10 - 11
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -104,9 +104,17 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             xtype: 'numbercolumn',
             hidden:true
         }, {
-            text: '单据编号',
+            text: '采购单号',
             dataIndex: 'pu_code',
             width: 200
+        },{
+            text: '供应商编号',
+            dataIndex: 'pu_vendcode',
+            width: 120
+        },{
+            text: '供应商名称',
+            dataIndex: 'pu_vendname',
+            width: 120
         }, {
             text: '单据状态',
             dataIndex: 'pu_status',
@@ -121,16 +129,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             xtype: 'datecolumn',
             width: 200
         }, {
-            text: '供应商名称',
-            dataIndex: 'pu_vendname',
-            width: 120
-        }, {
-            text: '含税金额',
-            dataIndex: 'pu_taxtotal',
-            xtype: 'numbercolumn',
-            width: 120
-        }, {
-            text: '金额',
+            text: '总额',
             dataIndex: 'pu_total',
             xtype: 'numbercolumn',
             width: 120,

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

@@ -39,11 +39,10 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype: 'button',
         text: '转采购验退单',
         bind: {
-            hidden: '{!id}'
-        },
+           hidden: '{turnHidden}'
+       },
         handler: 'turnOut'
     }],
-
     defaultItems: [{
         xtype: 'hidden',
         name: 'id',
@@ -75,7 +74,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         bind: '{pi_vendname}',
-        fieldLabel: '供应商名称'
+        fieldLabel: '供应商名称',
+        allowBlank : false,
     },{
         xtype : "datefield", 
         name : "pi_date", 
@@ -189,7 +189,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 8
+                    decimalPrecision: 8,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -242,16 +243,31 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     minValue:0
                 },
                 dataIndex : "pd_orderprice", 
-                width : 120.0, 
-                xtype : "numbercolumn"
-            }, 
-           {
+                width : 120.0,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+            }, {
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0,
+                editor : {
+                    xtype : "numberfield",
+                    decimalPrecision: 0,
+                    minValue: 0,
+                    maxValue: 100
+                }
+            },{
                 text : "含税金额", 
                 dataIndex : "pd_total", 
                 width : 120.0, 
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -266,22 +282,14 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 }
-            }, {
-                text : "税率", 
-                dataIndex : "pd_taxrate", 
-                width : 120.0,
-                editor : {
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                }
             },
             {
                 text : "未税金额", 
                 dataIndex : "pd_nettotal", 
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable : false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

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

@@ -157,7 +157,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -4,5 +4,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelModel', {
     
     data: {
         pi_class: '采购验收单'
-     }
+     },
+     formulas:{
+        turnHidden:{
+            bind:'{pi_statuscode}',
+            get:function(value){
+                return value!='AUDITED';
+            }
+        }
+    }
 });

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

@@ -145,7 +145,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

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

@@ -66,7 +66,8 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         bind: '{pi_vendname}',
-        fieldLabel: '供应商名称'
+        fieldLabel: '供应商名称',
+        allowBlank : false,
     },{
         xtype : "datefield", 
         name : "pi_date", 
@@ -173,15 +174,18 @@ 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 : "已转数", 
+            //     dataIndex : "pd_yqty", 
+            //     width : 120.0, 
+            //     xtype : "numbercolumn", 
+            //     format:'0',
+            //     items : null,
+            //     summaryType: 'sum'
+            // },
+            
+            {
                 text : "仓库id", 
                 dataIndex : "pd_whid", 
                 xtype : "numbercolumn",
@@ -221,27 +225,61 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 dataIndex : "pd_orderprice", 
                 width : 120.0, 
                 xtype : "numbercolumn"
+            },{
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0,
+                editor : {
+                    xtype : "numberfield",
+                    decimalPrecision: 0,
+                    minValue: 0,
+                    maxValue: 100
+                }
             }, 
-           {
+            {
                 text : "含税金额", 
                 dataIndex : "pd_total", 
                 width : 120.0, 
-                xtype : "numbercolumn",
-                summaryType: 'sum'
-            }, {
-                text : "税率", 
-                dataIndex : "pd_taxrate",
                 editor : {
-                    xtype : "numberfield"
-                },   
-                width : 120.0, 
-                xtype : "numbercolumn"
+                    xtype : "numberfield",
+                    decimalPrecision: 2,
+                    editable : false
+                },
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                summaryType: 'sum',
+                summaryRenderer: function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
             },
             {
                 text : "未税金额", 
                 dataIndex : "pd_nettotal", 
-                xtype : "numbercolumn",
-                summaryType: 'sum'
+                editor : {
+                    xtype : "numberfield",
+                    decimalPrecision: 2,
+                    editable : false
+                },
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                summaryType: 'sum',
+                summaryRenderer: function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
             },
             {
                 text : "采购单明细id", 
@@ -257,7 +295,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
-                flex:1,
                 format: '0000',
                 renderer: function(v) {
                     return v ? v : null;

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

@@ -21,7 +21,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                         addTitle: '供应商资料',
                         defaultCondition:"ve_statuscode='OPEN'",
                         dbfinds:[{
-                            from:'ve_id',to:'pi_vendid',ignore:true
+                            from:'id',to:'pi_vendid',ignore:true
                         },{
                             from:'ve_code',to:'pi_vendcode'
                         },{
@@ -156,7 +156,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -145,7 +145,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

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

@@ -203,7 +203,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 }
             }, 
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "sd_nettotal",
                 editor : {
                     xtype : "numberfield",
@@ -261,6 +261,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         xtype : 'textfield', 
         name : 'sa_sendstatus', 
         fieldLabel : '出货状态', 
+        hidden : true,
         readOnly:true
      }, {
         xtype : "textfield", 

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

@@ -156,7 +156,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -172,7 +172,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             }, 
            {
                 text : "含税金额", 
-                dataIndex : "pd_total", 
+                dataIndex : "pd_ordertotal", 
                 width : 120.0, 
                 editor : {
                     xtype : "numberfield",
@@ -203,7 +203,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 }
             },
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "pd_nettotal", 
                 editor : {
                     xtype : "numberfield",

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

@@ -156,7 +156,7 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -107,7 +107,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

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

@@ -183,7 +183,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             }, 
            {
                 text : "含税金额", 
-                dataIndex : "pd_total", 
+                dataIndex : "pd_ordertotal", 
                 width : 120.0, 
                 editor : {
                     xtype : "numberfield",
@@ -214,7 +214,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 }
             },
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "pd_nettotal", 
                 editor : {
                     xtype : "numberfield",

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

@@ -154,7 +154,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -107,11 +107,10 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '含税金额',
+            text: '含税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
-            width: 120,
-            flex: 1
+            width: 120
         }],
         relativeColumn: [{
             text: 'id',

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

@@ -223,7 +223,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -145,7 +145,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

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

@@ -219,7 +219,7 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -254,7 +254,7 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                 }
             },
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "pd_nettotal", 
                 editor : {
                     xtype : "numberfield",

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

@@ -230,7 +230,7 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -145,7 +145,7 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

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

@@ -256,7 +256,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                 }
             },
             {
-                text: "未税金额",
+                text: "未税金额",
                 dataIndex: "pd_nettotal",
                 editor : {
                     xtype : "numberfield",

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

@@ -218,7 +218,7 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                             "width": 100,
                         }, {
                             "text": "单位",
-                            "dataIndex": "pr_spec",
+                            "dataIndex": "pr_unit",
                             "width": 100,
                         },{
                             "text": "仓库id",

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

@@ -145,7 +145,7 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '不含税金额',
+            text: '税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,

+ 304 - 0
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -0,0 +1,304 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.stock.stockamount.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'stock-stockamount-datalist',
+    controller: 'stock-stockamount-datalist',
+    viewModel: 'stock-stockamount-datalist',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    dataUrl:'/api/document/product/ReserveCost',                 
+
+    tbar: [{
+        width: 150,
+        name: 'pr_code',
+        xtype: 'textfield',
+        emptyText : '物料编号'
+    },{
+        width: 150,
+        name: 'pr_detail',
+        xtype: 'textfield',
+        emptyText : '物料名称'
+    },{
+        width: 150,
+        name: 'wh_code',
+        xtype: 'textfield',
+        emptyText : '仓库编号'
+    },{
+        width: 150,
+        name: 'wh_name',
+        xtype: 'textfield',
+        emptyText : '仓库名称'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+
+    columns : [{
+        text : "物料编号", 
+        width : 150, 
+        dataIndex : "rc_prodCode", 
+        xtype : "", 
+    },{
+        text : "物料名称", 
+        width : 200.0, 
+        dataIndex : "rc_prodDetail", 
+    }, 
+    {
+        text : "物料规格", 
+        dataIndex : "rc_prodSpec", 
+        width : 120.0, 
+    }, 
+    {
+        text : "单位", 
+        dataIndex : "rc_prodUnit", 
+        width : 120.0, 
+    }, 
+    {
+        text : "仓库编号", 
+        dataIndex : "rc_whCode", 
+        width : 0, 
+    }, 
+    {
+        text : "仓库名称", 
+        dataIndex : "rc_whName", 
+        width : 120.0, 
+    }, 
+    {
+        text : "数量", 
+        format:'0,000',
+        xtype:'numbercolumn',
+        dataIndex : "rc_number", 
+        width : 120.0, 
+    }, 
+    {
+        text : "单价", 
+        dataIndex : "rc_price", 
+        width : 120.0, 
+        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 : "金额", 
+        dataIndex : "rc_amount", 
+        flex : 1.0, 
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+})
+
+

+ 10 - 0
frontend/saas-web/app/view/stock/stockamount/DataListController.js

@@ -0,0 +1,10 @@
+Ext.define('saas.view.stock.stockamount.DataListController', {
+    extend: 'saas.view.core.base.BasePanelController',
+    alias: 'controller.stock-stockamount-datalist',
+
+    init: function (form) {
+        var me = this;
+        this.control({
+        });
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/stock/stockamount/DataListlModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.stock.stockamount.DataListModel', {
+    extend: 'saas.view.core.base.BasePanelModel',
+    alias: 'viewmodel.stock-stockamount-datalist'
+});

+ 51 - 21
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -4,25 +4,28 @@ Ext.define('saas.view.sys.config.FormPanel', {
 
     controller: 'sys-config-formpanel',
     viewModel: 'sys-config-formpanel',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     
     //字段属性
     _idField: 'id',
-    _readUrl:'/api/document/vendor/read/',
-    _saveUrl:'/api/document/vendor/save',
+    _readUrl:'/api/commons/enterprise/read',
+    _saveUrl:'/api/commons/enterprise/save',
 
     //基础属性
     frame:true,
     initId: 0,
-    layout: 'column',
+    layout: 'vbox',
     autoScroll: true,
     border: 1,
     bodyPadding: 5,
 
     fieldDefaults: {
-        margin: '0 5 5 0',
+        margin: '0 5 5 30',
         labelAlign: 'right',
         labelWidth: 90,
-        columnWidth: 0.25,
+        width:300,
         blankText: '该字段不能为空'
     },
 
@@ -33,50 +36,60 @@ Ext.define('saas.view.sys.config.FormPanel', {
         frame:true,
         items:['->',{
             text:'保存',
-            handler:function(){
-
-            }
+            formBind:true,
+            name:'save'
         }]
     },
 
     items: [{
+        bind:'{companyId}',
         xtype: 'hidden',
-        name: 'id',
+        name: 'companyId',
         fieldLabel: 'id',
         allowBlank: true,
-        columnWidth: 0.25
+        width:600
     },{
+        bind:'{en_name}',
         xtype: 'textfield',
         name: 'en_name',
         fieldLabel: '公司名称',
-        allowBlank: false,
-        columnWidth: 0.5
+        allowBlank: true,
+        editable:false,
+        readOnly:true,
+        width:600
     },{
+        bind:'{en_address}',
         xtype: 'textfield',
         name: 'en_address',
         fieldLabel: '公司地址',
-        allowBlank: true,
-        columnWidth: 0.5
+        allowBlank: false,
+        width:600
     },{
+        bind:'{en_tel}',
         xtype: 'textfield',
         name: 'en_tel',
         fieldLabel: '电话',
-        allowBlank: true,
+        allowBlank: false,
         columnWidth: 0.25
     },{
+        bind:'{en_fax}',
         xtype: 'textfield',
         name: 'en_fax',
         fieldLabel: '传真',
         allowBlank: true,
         columnWidth: 0.5
     },{
+        bind:'{en_begindate}',
         xtype : "datefield", 
-        name : "en_begindate", 
+        name : "en_begindate",
+        format:'Y-m-d H:i:s', 
         fieldLabel : "开账日期", 
         allowBlank : true, 
         editable:false,
-        columnWidth : 0.25
+        hideTrigger:true,
+        readOnly:true
     },{ 
+        bind:'{en_pricemethod}',
         displayField : "display", 
         editable:false,
         hideTrigger : false, 
@@ -97,6 +110,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         allowBlank : false, 
         columnWidth : 0.25
     },{  
+        bind:'{en_signet}',
         xtype : "textfield", 
         name : "en_signet", 
         fieldLabel : "打印章上传", 
@@ -104,22 +118,38 @@ Ext.define('saas.view.sys.config.FormPanel', {
         editable:false,
         columnWidth : 0.25
     },{  
+        ignore:true,
+        bind:'{updateTime}',
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 
         allowBlank : true, 
+        hideTrigger:true,
+        format:'Y-m-d H:i:s',
         editable:false,
+        readOnly:true,
         columnWidth : 0.25
     }],
 
     initComponent: function () {
         var me = this,
         viewModel = me.getViewModel();
+        var url = me._readUrl;
+        me.BaseUtil.request({url })
+        .then(function(res) {
+            if(res.success) {
+                var d = res.data;
+                viewModel.setData(d)
+            }
+        })
+        .catch(function(response) {
+            console.error(response);
+        });
 
-        viewModel.set('createTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
-        viewModel.set('updateTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
-        viewModel.setFormulas(o);
-        viewModel.set(statusCodeField, auditTexts.unAuditCode);
         me.callParent(arguments);
+    },
+
+    refresh:function(){
+        this.ownerCt.setTitle('参数设置')
     }
 });

+ 28 - 36
frontend/saas-web/app/view/sys/config/FormPanelController.js

@@ -5,6 +5,17 @@ Ext.define('saas.view.sys.config.FormPanelController', {
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     FormUtil: Ext.create('saas.util.FormUtil'),
 
+    init: function (form) {
+        var me = this;
+        this.control({
+            'button[name=save]':{
+                click:function(){
+                    me.onSave();
+                }
+            }
+        });
+    },
+
     onSave: function() {
         var me = this,
         form = this.getView();
@@ -19,50 +30,31 @@ Ext.define('saas.view.sys.config.FormPanelController', {
             showToast('未修改数据,请修改后保存');
             return false;
         }
-        //form里面数据
-        var formData = form.getFormData();
         
-        me.save(formData);
-    },
-
-    save:function(formData){
-        var me = this,
-        form = this.getView(),
-        detailCount = form.detailCount,
-        viewModel = me.getViewModel(),
-        modelData = viewModel.getData();
-
-        var params = {
-            main:formData.main
-        };
-
-        for(var i = 0; i < detailCount; i++) {
-            params['items' + ( i + 1)] = formData['detail' + i];
-        }
-
-        // 只有一个从表时从表字段改为items
-        if(detailCount == 1) {
-            params.items = params.items1;
-            delete params.items1;
-        }
-
+        viewModel = me.getViewModel();
+        var formData = viewModel.data;
+        formData.en_name = null;
+        formData.updateTime = null;
         me.BaseUtil.request({
             url: form._saveUrl,
-            params: JSON.stringify(params),
+            params: JSON.stringify(formData),
             method: 'POST',
         })
         .then(function(localJson) {
             if(localJson.success){
-                var id = localJson.data.id;
-                var code = localJson.data.code;
-                form.initId = id;
-                form.FormUtil.loadData(form);
                 showToast('保存成功');
-
-                var newId = form.xtype + '-' + id;
-                var newTitle = form._title + '(' + code + ')';
-
-                refreshTabTitle(newId, newTitle);
+                viewModel = form.getViewModel();
+                var url = form._readUrl;
+                form.BaseUtil.request({url })
+                .then(function(res) {
+                    if(res.success) {
+                        var d = res.data;
+                        viewModel.setData(d)
+                    }
+                })
+                .catch(function(response) {
+                    console.error(response);
+                });
             }
         })
         .catch(function(res) {

+ 21 - 10
frontend/saas-web/app/view/sys/finish/DataList.js

@@ -7,9 +7,9 @@ Ext.define('saas.view.sys.finish.DataList', {
     autoScroll: true,
     frame:true,
     layout:'fit',
-    dataUrl:'http://192.168.253.31:8920/endProduct/list',
-    endAccount:'http://192.168.253.31:8920/endProduct/endAccount',
-    unEndAccount:'http://192.168.253.31:8920/endProduct/unEndAccount',
+    dataUrl:'/api/commons/endProduct/list',
+    endAccount:'/api/commons/endProduct/endAccount',
+    unEndAccount:'/api/commons/endProduct/unEndAccount',
     tbar: [{
         cls:'x-tbar-display',
         width: 180,
@@ -80,20 +80,31 @@ Ext.define('saas.view.sys.finish.DataList', {
         dataIndex : "id", 
         xtype : "numbercolumn",   
     },{
-        text:'结账',
-        dataIndex : "ml_caller",
-        xtype:'datecolumn',
-        width : 200.0, 
+        text:'结账期间',
+        dataIndex : "ml_keyvalue",
+        xtype:'',
+        width : 160.0, 
     },{
         text : "操作日期", 
         width : 200.0, 
-        dataIndex : "ml_code", 
+        format:'Y-m-d H:i:s',
+        dataIndex : "createTime", 
         xtype:'datecolumn',
     }, 
     {
-        text : "操作", 
+        text : "操作类型", 
         dataIndex : "ml_content", 
         width : 220.0, 
+    },
+    {
+        text : "操作员", 
+        dataIndex : "ml_man", 
+        width : 170.0, 
+    },
+    {
+        text : "结果", 
+        dataIndex : "ml_result", 
+        width : 220.0, 
     }],
 
     condition:'',
@@ -261,7 +272,7 @@ Ext.define('saas.view.sys.finish.DataList', {
     },
 
     refresh:function(){
-        //debugger
+        this.ownerCt.setTitle('结账/反结账')
     }
 
 });

+ 11 - 0
frontend/saas-web/overrides/i18n.js

@@ -76,4 +76,15 @@ function warnMsg(msg, fn){
      	icon: Ext.Msg.WARNING,
      	fn: fn
 	});
+}
+
+function deleteWarn(msg, fn){
+	Ext.MessageBox.show({
+     	title: '提示',
+     	msg: msg || '确定要删除当前表单?',
+     	buttons: Ext.Msg.YESNO,
+     	icon: Ext.Msg.WARNING,
+         fn: fn,
+         renderTo: Ext.getCmp('main-tab-panel').getActiveTab().getEl()
+	});
 }

+ 5 - 1
frontend/saas-web/resources/json/navigation.json

@@ -106,7 +106,9 @@
         }, {
             "text": "物料收发汇总表"
         }, {
-            "text": "物料库存数量金额表"
+            "text": "物料库存数量金额表",
+            "id":"stock-stockamount-datalist",
+            "viewType": "stock-stockamount-datalist"
         }]
     }]
 }, {
@@ -206,6 +208,7 @@
     }, {
         "text": "辅助资料",
         "items": [{
+            "config":"vendorkind",
             "id":"document-kind",
             "text": "供应商类型",
             "viewType": "document-kind",
@@ -216,6 +219,7 @@
             "viewType": "other-address",
             "leaf": true
         }, {
+            "index":"customer",
             "id":"document-kind",
             "text": "客户类型",
             "viewType": "document-kind",