浏览代码

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

guq 7 年之前
父节点
当前提交
01f1f483e8
共有 100 个文件被更改,包括 1273 次插入418 次删除
  1. 1 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 5 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  3. 1 0
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  4. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  5. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  6. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  7. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProducttypeMapper.java
  8. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java
  9. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  10. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  11. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  12. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  13. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  14. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  15. 15 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  16. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  17. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  18. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  19. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  20. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  21. 3 0
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  22. 4 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  23. 3 0
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  24. 3 0
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  25. 3 0
      applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml
  26. 3 0
      applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml
  27. 3 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  28. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferdetailMapper.java
  29. 19 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java
  30. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  31. 3 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  32. 3 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  33. 15 0
      applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml
  34. 66 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java
  35. 62 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDetailDTO.java
  36. 156 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java
  37. 7 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  38. 8 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  39. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java
  40. 58 3
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  41. 242 0
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  42. 2 2
      base-servers/account/account-server/src/main/resources/mapper/AccountRoleMapper.xml
  43. 1 0
      frontend/saas-web/app/view/auth/CompanyPicker.scss
  44. 2 1
      frontend/saas-web/app/view/auth/LoginController.js
  45. 6 3
      frontend/saas-web/app/view/core/base/BasePanel.js
  46. 29 18
      frontend/saas-web/app/view/core/base/GridPanel.js
  47. 1 1
      frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js
  48. 1 1
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  49. 1 1
      frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js
  50. 1 1
      frontend/saas-web/app/view/core/dbfind/types/ProductMultiDbfindTrigger.js
  51. 1 1
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  52. 7 4
      frontend/saas-web/app/view/core/form/DataMultiCombo.js
  53. 1 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  54. 30 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  55. 1 0
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  56. 3 0
      frontend/saas-web/app/view/document/customer/BasePanel.js
  57. 0 77
      frontend/saas-web/app/view/document/employee/BasePanel.js
  58. 0 10
      frontend/saas-web/app/view/document/employee/BasePanelController.js
  59. 0 4
      frontend/saas-web/app/view/document/employee/BasePanelModel.js
  60. 0 60
      frontend/saas-web/app/view/document/employee/FormController.js
  61. 0 8
      frontend/saas-web/app/view/document/employee/FormModel.js
  62. 0 74
      frontend/saas-web/app/view/document/employee/FormPanel.js
  63. 59 3
      frontend/saas-web/app/view/document/kind/ChildForm.js
  64. 60 0
      frontend/saas-web/app/view/document/kind/Kind.js
  65. 30 0
      frontend/saas-web/app/view/document/kind/KindModel.js
  66. 27 0
      frontend/saas-web/app/view/document/other/Employee.js
  67. 2 1
      frontend/saas-web/app/view/document/product/FormModel.js
  68. 2 0
      frontend/saas-web/app/view/document/product/FormPanel.js
  69. 12 9
      frontend/saas-web/app/view/main/Main.js
  70. 56 27
      frontend/saas-web/app/view/main/Main.scss
  71. 1 2
      frontend/saas-web/app/view/main/MainController.js
  72. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  73. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js
  74. 1 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  75. 1 1
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  76. 3 0
      frontend/saas-web/app/view/money/othreceipts/FormPanelModel.js
  77. 1 1
      frontend/saas-web/app/view/money/othreceipts/QueryPanel.js
  78. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  79. 3 0
      frontend/saas-web/app/view/money/othspendings/FormPanelModel.js
  80. 3 3
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  81. 4 0
      frontend/saas-web/app/view/money/payBalance/FormPanelModel.js
  82. 5 5
      frontend/saas-web/app/view/money/recBalance/QueryPanel.js
  83. 3 0
      frontend/saas-web/app/view/purchase/purchase/FormPanelModel.js
  84. 6 6
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  85. 10 8
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelModel.js
  86. 5 5
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  87. 4 3
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelModel.js
  88. 11 2
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  89. 26 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  90. 4 0
      frontend/saas-web/app/view/sale/sale/FormPanelModel.js
  91. 2 2
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  92. 1 1
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  93. 4 0
      frontend/saas-web/app/view/sale/saleIn/FormPanelModel.js
  94. 2 2
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  95. 1 1
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  96. 4 0
      frontend/saas-web/app/view/sale/saleOut/FormPanelModel.js
  97. 2 2
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  98. 3 2
      frontend/saas-web/app/view/stock/otherIn/FormPanelModel.js
  99. 3 2
      frontend/saas-web/app/view/stock/otherOut/FormPanelModel.js
  100. 45 40
      frontend/saas-web/app/view/sys/feedback/FormPanel.js

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -77,6 +77,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     RECALANCE_OUTNOWBALANCE(74003,"本次核销金额不能大于未核销金额"),
     BEFORE_UNAUDIT(74006, "单据:<u>%s</u>未审核,无法反审核"),
     BANK_AMOUNT_NOTENOUGH(74004, "资金账号不足"),
+    SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
 
 
 

+ 5 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -51,6 +51,11 @@ public enum Operation {
      */
     BANNED("msg.banned", "msg.bannedSuccess"),
 
+    /**
+     * 启用操作
+     */
+    ENABLE("msg.enable", "msg.enableSuccess"),
+
     /**
      * 记账
      */

+ 1 - 0
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -33,6 +33,7 @@ msg.resHungSuccess=\u89e3\u6302\u6210\u529f
 msg.checkSuccess=\u6838\u5bf9\u6210\u529f
 msg.printSuccess=\u6253\u5370\u6210\u529f
 msg.bannedSuccess=\u7981\u7528\u6210\u529f
+msg.enableSuccess=\u542f\u7528\u6210\u529f
 msg.resBannedSuccess=\u53cd\u7981\u7528\u6210\u529f
 msg.modifySuccess=\u6570\u636e\u66f4\u65b0\u6210\u529f
 msg.modifyDetailSuccess=\u66f4\u65b0\u660e\u7ec6\u6570\u636e\u6210\u529f

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

@@ -30,4 +30,6 @@ public interface AddressMapper extends CommonBaseMapper<Address> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Address> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromPurchase(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -25,4 +25,6 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Customerkind> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromCustomer(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -26,4 +26,6 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Productbrand> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -25,4 +25,6 @@ public interface ProducttypeMapper extends CommonBaseMapper<Producttype> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Producttype> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -25,4 +25,6 @@ public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Productunit> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -26,4 +26,6 @@ public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Vendorkind> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromVendor(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -65,12 +65,25 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            //校验是否有采购单使用了这个地址
+            validUse(id);
             addressMapper.deleteByPrimaryKey(id);
             messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
 
+    /**
+     * 校验采购地址是否已经被使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromPurchase(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 批量删除
      * @param ids

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Bom;
@@ -200,7 +201,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
             getMapper().updateByPrimaryKeySelective(bom);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -226,7 +227,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 getMapper().updateByPrimaryKeySelective(bom);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.CustomerDTO;
@@ -365,7 +366,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             getMapper().updateByPrimaryKeySelective(customer);
             docBaseDTO = getBaseDTOById(id);
             //日志
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
         }
         return docBaseDTO;
     }
@@ -400,7 +401,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             getMapper().updateByPrimaryKeySelective(customer);
             docBaseDTO = getBaseDTOById(id);
             //日志
-        messageLogService.open(docBaseDTO);
+        messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
         }
         return docBaseDTO;
     }

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

@@ -60,12 +60,25 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            //查找客户资料里是否用了该客户类型
+            validUse(id);
             customerkindMapper.deleteByPrimaryKey(id);
             messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
 
+    /**
+     * 校验客户资料里是否已使用这个客户类型
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromCustomer(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -12,6 +12,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.ProductDTO;
@@ -309,7 +310,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             getMapper().updateByPrimaryKeySelective(product);
             //记录LOG
             docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -336,7 +337,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                 getMapper().updateByPrimaryKeySelective(product);
                 //记录LOG
                 docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }
         }else{

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

@@ -56,6 +56,10 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
 
     @Override
     public boolean removeByPrimaryKey(Long id){
+        if (id == null || id < 0){
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+        validUse(id);
         productbrandMapper.deleteByPrimaryKey(id);
         //记录日志
         DocBaseDTO docBaseDTO = new DocBaseDTO(id, null, LOG_NAME);
@@ -63,6 +67,17 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         return true;
     }
 
+    /**
+     * 校验物料品牌是否已经在使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     @Override
     public List<ComboDTO> getCombo() {
         return getMapper().getCombo(BaseContextHolder.getCompanyId());

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

@@ -64,6 +64,7 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             producttypeMapper.deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -71,6 +72,17 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
         return true;
     }
 
+    /**
+     * 校验物料类型是否已经被物料资料所使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -52,6 +52,7 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             getMapper().deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -59,6 +60,17 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
         return true;
     }
 
+    /**
+     * 校验物料单位是否已使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     @Override
     public List<Productunit> findAll(){
         List<Productunit> productunitList = getMapper().selectAll();

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

@@ -11,6 +11,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.VendorDTO;
@@ -303,7 +304,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             getMapper().updateByPrimaryKeySelective(vendor);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -331,7 +332,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 getMapper().updateByPrimaryKeySelective(vendor);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -54,6 +54,7 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             vendorkindMapper.deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -61,6 +62,17 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
         return true;
     }
 
+    /**
+     * 校验供应商类型是否已被供应商资料使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromVendor(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
@@ -180,7 +181,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             getMapper().updateByPrimaryKeySelective(warehouse);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -206,7 +207,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
                 getMapper().updateByPrimaryKeySelective(warehouse);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -198,4 +198,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromPurchase" resultType="int">
+        SELECT COUNT(*) FROM PURCHASE WHERE PU_SHIPADDRESSCODE = (SELECT AD_ADDRESS FROM ADDRESS WHERE AD_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

+ 4 - 0
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -340,6 +340,10 @@
         select bk_bankcode from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
     </select>
 
+  <select id="selectBankId" parameterType="java.lang.String" resultType="java.lang.Long">
+        select bk_id from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+   </select>
+
   <select id="check" parameterMap="checkParamMap" statementType="CALLABLE">
         CALL SP_LIMITBASE(?, ?, ?, ?,?)
     </select>

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

@@ -139,4 +139,7 @@
             </if>
         </where>
     </select>
+    <select id="getCountFromCustomer" resultType="int">
+        SELECT COUNT(*) FROM CUSTOMER WHERE CU_TYPE = (SELECT CK_NAME FROM CUSTOMERKIND WHERE CK_ID = #{id}) AND companyid = #{companyId};
+    </select>
 </mapper>

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

@@ -146,4 +146,7 @@
         </if>
     </where>
   </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_BRAND = (SELECT PB_NAME FROM PRODUCTBRAND WHERE PB_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

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

@@ -145,4 +145,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PT_NAME display,PT_NAME value FROM PRODUCTTYPE WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_KIND = (SELECT PT_NAME FROM PRODUCTTYPE WHERE PT_ID = #{id}) AND companyId=#{companyId}
+    </select>
 </mapper>

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

@@ -139,4 +139,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PU_NAME display,PU_NAME value FROM PRODUCTUNIT WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_UNIT = (SELECT PU_NAME FROM PRODUCTUNIT WHERE PU_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

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

@@ -145,4 +145,7 @@
         </if>
     </where>
   </select>
+    <select id="getCountFromVendor" resultType="int">
+        SELECT COUNT(*) FROM VENDOR WHERE VE_TYPE = (SELECT VK_NAME FROM VENDORKIND WHERE VK_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

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

@@ -13,7 +13,7 @@ public interface FundtransferdetailMapper {
 
     int insertSelective(Fundtransferdetail record);
 
-    List<Fundtransferdetail> selectByPrimaryKey(@Param("id") Integer ftdId, @Param("companyId") Integer companyId);
+    List<Fundtransferdetail> selectByPrimaryKeyList(@Param("id") Integer ftdId, @Param("companyId") Integer companyId);
 
     int updateByPrimaryKeySelective(Fundtransferdetail record);
 

+ 19 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java

@@ -47,6 +47,25 @@ public class Fundtransferdetail extends CommonBaseEntity implements Serializable
 
     private String ftd_text5;
 
+    private Double bk_outthisamount;
+    private Double bk_inthisamount;
+
+    public Double getBk_outthisamount() {
+        return bk_outthisamount;
+    }
+
+    public void setBk_outthisamount(Double bk_outthisamount) {
+        this.bk_outthisamount = bk_outthisamount;
+    }
+
+    public Double getBk_inthisamount() {
+        return bk_inthisamount;
+    }
+
+    public void setBk_inthisamount(Double bk_inthisamount) {
+        this.bk_inthisamount = bk_inthisamount;
+    }
+
     public Date getFt_date() {
         return ft_date;
     }

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -200,7 +200,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
 
         //资金
         //取从表金额
-        List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId()));
+        List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKeyList(id, Math.toIntExact(BaseContextHolder.getCompanyId()));
         Iterator isList = fundtransferdetailList.iterator();
         while (isList.hasNext()){
             Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
@@ -305,7 +305,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
     public Fundtran select(int id) {
         Fundtran fundtran = new Fundtran();
         fundtran.setMain(fundtransferMapper.selectByPrimaryKey(id));
-        fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId())));
+        fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKeyList(id, Math.toIntExact(BaseContextHolder.getCompanyId())));
         return fundtran;
     }
 

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

@@ -137,6 +137,9 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             Double namount = new Double(0);
             if(sourceId!=0){
                 Subledger subledger = subledgerMapper.selectByPrimaryKey(sourceId);
+                if (subledger == null){
+                    throw new BizException(500, BizExceptionCode.SUBLEDGER_NOT_EXIS.getMessage());
+                }
                 namount = subledger.getSl_namount();
             }
             //本次核销金额不能大于未核销金额

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

@@ -135,6 +135,9 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             Double namount = new Double(0);
             if(sourceId!=0){
                 Subledger subledger = subledgerMapper.selectByPrimaryKey(sourceId);
+                if (subledger == null){
+                    throw new BizException(500, BizExceptionCode.SUBLEDGER_NOT_EXIS.getMessage());
+                }
                 namount = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount();
             }
             //本次核销金额不能大于未核销金额

+ 15 - 0
applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml

@@ -25,12 +25,17 @@
     <result column="ftd_text3" property="ftd_text3" jdbcType="VARCHAR" />
     <result column="ftd_text4" property="ftd_text4" jdbcType="VARCHAR" />
     <result column="ftd_text5" property="ftd_text5" jdbcType="VARCHAR" />
+      <result column="bk_outthisamount" property="bk_outthisamount" jdbcType="DOUBLE" />
+      <result column="bk_inthisamount" property="bk_inthisamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     ftd_id, ftd_ftid, ftd_detno, ftd_ym, ftd_bankid, ftd_bankcode, ftd_bankname, ftd_inbankid, 
     ftd_inbankcode, ftd_inbankname, ftd_nowbalance, ftd_paymethod, ftd_paycode, ftd_remark, 
     companyid, updaterId, updatedate, ftd_text1, ftd_text2, ftd_text3, ftd_text4, ftd_text5
   </sql>
+    <sql id="Bank_Column_List">
+        b.bk_thisamount as bk_outthisamount,c.bk_thisamount as bk_inthisamount
+    </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
@@ -38,6 +43,16 @@
     where ftd_ftid = #{id,jdbcType=INTEGER} and companyId = #{companyId}
   </select>
 
+    <select id="selectByPrimaryKeyList" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select
+    <include refid="Base_Column_List"/>,
+        <include refid="Bank_Column_List" />
+    from fundtransferdetail,
+    (select bk_id,bk_thisamount from bankinformation) b,
+    (select bk_id, bk_thisamount from bankinformation)c
+    where ftd_ftid = #{id,jdbcType=INTEGER} and companyId = #{companyId} and ftd_bankid = b.bk_id and
+    ftd_inbankid = c.bk_id
+    </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from fundtransferdetail
     where ftd_ftid = #{id,jdbcType=INTEGER}

+ 66 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java

@@ -0,0 +1,66 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class PurchaseDTO extends CommonBaseEntity implements Serializable {
+
+    private String pu_code;
+
+    private Date pu_date;
+
+    private Integer pu_vendid;
+
+    private String pu_vendcode;
+
+    private String pu_vendname;
+
+    private Integer pu_buyerid;
+
+    private String pu_buyercode;
+
+    private String pu_buyername;
+
+    private Date pu_delivery;
+
+    private Double pu_taxtotal;
+
+    private Double pu_total;
+
+    private String pu_remark;
+
+    private String pu_totalupper;
+
+    private String pu_printstatus;
+
+    private String pu_printstatuscode;
+
+    private String pu_acceptstatuscode;
+
+    private String pu_acceptstatus;
+
+    private String pu_statuscode;
+
+    private String pu_status;
+
+    private String pu_text1;
+
+    private String pu_text2;
+
+    private String pu_text3;
+
+    private String pu_text4;
+
+    private String pu_text5;
+
+    private String pu_shipaddresscode;
+
+    private String pu_auditman;
+
+    private Date pu_auditdate;
+
+}

+ 62 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDetailDTO.java

@@ -0,0 +1,62 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class PurchaseDetailDTO extends CommonBaseEntity implements Serializable {
+
+    private  Long pd_puid;
+
+    private String pd_code;
+
+    private Integer pd_detno;
+
+    private Long pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_qty;
+
+    private Double pd_price;
+
+    private Double pd_taxprice;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_taxtotal;
+
+    private Double pd_acceptqty;
+
+    private Date pd_delivery;
+
+    private String pd_salecode;
+
+    private Integer pd_saledetno;
+
+    private Integer pd_sdid;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Double pd_yqty;
+
+    private  String pd_remark;
+
+    private ProductDTO productDTO;
+}

+ 156 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java

@@ -0,0 +1,156 @@
+package com.usoftchina.saas.sale.dto;
+
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-10-10 16:42
+ **/
+@Data
+public class PurchaseListDTO extends CommonBaseEntity implements Serializable {
+
+    //主表信息
+    private  Integer pu_id;
+
+    private String pu_code;
+
+    private Date pu_date;
+
+    private Integer pu_vendid;
+
+    private String pu_vendcode;
+
+    private String pu_vendname;
+
+    private Integer pu_buyerid;
+
+    private String pu_buyercode;
+
+    private String pu_buyername;
+
+    private Date pu_delivery;
+
+    private Double pu_taxtotal;
+
+    private Double pu_total;
+
+    private String pu_remark;
+
+    private String pu_totalupper;
+
+    private String pu_printstatus;
+
+    private String pu_printstatuscode;
+
+    private String pu_acceptstatuscode;
+
+    private String pu_acceptstatus;
+
+    private String pu_statuscode;
+
+    private String pu_status;
+
+    private String pu_text1;
+
+    private String pu_text2;
+
+    private String pu_text3;
+
+    private String pu_text4;
+
+    private String pu_text5;
+
+    private String pu_shipaddresscode;
+
+    private Date pu_auditdate;
+
+    private String pu_auditman;
+
+    //从表字段
+    private Long pd_id;
+
+    private  Long pd_puid;
+
+    private String pd_code;
+
+    private Integer pd_detno;
+
+    private Integer pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_qty;
+
+    private Double pd_price;
+
+    private Double pd_taxprice;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_taxtotal;
+
+    private Double pd_acceptqty;
+
+    private Date pd_delivery;
+
+    private String pd_salecode;
+
+    private Integer pd_saledetno;
+
+    private Integer pd_sdid;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Double pd_yqty;
+
+    private String pd_remark;
+
+    private String pd_ordercode;
+
+    //private ProductDTO productDTO;
+    private Long pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private String pr_kind;
+    private String pr_orispeccode;
+    private long pr_whid;
+    private String pr_whcode;
+    private String pr_whname;
+    private long pr_zxbzs;
+    private long pr_leadtime;
+    private String pr_brand;
+    private String pr_standardprice;
+    private String pr_purcprice;
+    private String pr_saleprice;
+    private long pr_vendid;
+    private String pr_vendname;
+    private String pr_vendcode;
+    private Date pr_docdate;
+    private long pr_recordmanid;
+    private String pr_recordman;
+    private String pr_status;
+    private String pr_statuscode;
+    private String pr_text1;
+    private String pr_text2;
+    private String pr_text3;
+    private String pr_text4;
+}

+ 7 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -186,7 +186,13 @@ public class SaleController {
        return Result.success();
     }
 
-    @GetMapping("/test")
+    @PostMapping("/saleTurnPurchase/{id}")
+    public Result saleTurnPurchase(@PathVariable("id") Long id){
+        DocBaseDTO baseDTO = saleService.saleTurnPurchase(id);
+        return Result.success(baseDTO);
+    }
+
+  @GetMapping("/test")
     public String test() {
         return "配置构建success-1";
     }

+ 8 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.sale.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.sale.dto.PurchaseDTO;
+import com.usoftchina.saas.sale.dto.PurchaseDetailDTO;
 import com.usoftchina.saas.sale.po.Sale;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
@@ -42,4 +44,10 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
     Integer checkSendStatus(Long id);
 
     void updateCreator(@Param("userId") Long userId, @Param("userName") String userName, @Param("id") Long id);
+
+    void turnPurchase(PurchaseDTO purchase);
+
+    void turnPurchaseDetail(List<PurchaseDetailDTO> list);
+
+    Integer selectPurchaseId(@Param("code") String code,@Param("companyid") Long companyid);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java

@@ -44,4 +44,6 @@ public interface SaleService {
     void batchClose(BatchDealBaseDTO baseDTOs);
 
     void batchOpen(BatchDealBaseDTO baseDTOs);
+
+    DocBaseDTO saleTurnPurchase(Long id);
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
@@ -14,12 +15,11 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.sale.dto.SaleDTO;
-import com.usoftchina.saas.sale.dto.SaleDetailDTO;
-import com.usoftchina.saas.sale.dto.SaleFormDTO;
+import com.usoftchina.saas.sale.dto.*;
 import com.usoftchina.saas.sale.mapper.*;
 import com.usoftchina.saas.sale.po.Sale;
 import com.usoftchina.saas.sale.po.SaleDetail;
@@ -524,6 +524,61 @@ public class SaleServiceImpl implements SaleService{
 
     }
 
+    @Override
+    public DocBaseDTO saleTurnPurchase(Long id) {
+        Sale sale = saleMapper.selectByPrimaryKey(id);
+        List<SaleList> dateilList = saleListMapper.selectSaleListByCondition("sa_id="+id,BaseContextHolder.getCompanyId());
+
+        PurchaseDTO purchase = new PurchaseDTO();
+        List<PurchaseDetailDTO> listPurchaseDetail = new ArrayList<PurchaseDetailDTO>();
+
+        //销售主表转采购主表
+        Result<String> result = maxnumberService.getMaxnumber(BillCodeSeq.PURCHASE.getCaller(),false);
+        purchase.setPu_code(result.getData());
+        purchase.setPu_status(Status.UNAUDITED.getDisplay());
+        purchase.setPu_statuscode(Status.UNAUDITED.toString());
+        purchase.setCompanyId(BaseContextHolder.getCompanyId());
+        purchase.setCreatorId(BaseContextHolder.getUserId());
+        purchase.setCreateTime(new Date());
+        purchase.setCreatorName(BaseContextHolder.getUserName());
+        saleMapper.turnPurchase(purchase);
+
+        Long purchaseId = purchase.getId();
+        for (SaleList detail : dateilList){
+            PurchaseDetailDTO purchaseDetailDTO = new PurchaseDetailDTO();
+            Double taxPrice = detail.getPr_purcprice()==null?new Double(0):Double.valueOf(detail.getPr_purcprice());
+            Double taxrate = detail.getSd_taxrate()==null?new Double(0):detail.getSd_taxrate();
+            Double qty = detail.getSd_qty()==null?new Double(0):detail.getSd_qty();
+            purchaseDetailDTO.setPd_prodid(Long.valueOf(String.valueOf(detail.getSd_prodid())));
+            purchaseDetailDTO.setPd_prodcode(detail.getSd_prodcode());
+            purchaseDetailDTO.setPd_detno(detail.getSd_detno());
+            purchaseDetailDTO.setPd_qty(detail.getSd_qty());
+            purchaseDetailDTO.setPd_price(taxPrice/(1+taxrate));
+            purchaseDetailDTO.setPd_salecode(sale.getSa_code());
+            purchaseDetailDTO.setPd_saledetno(detail.getSd_detno());
+            purchaseDetailDTO.setPd_taxrate(taxrate);
+            purchaseDetailDTO.setPd_taxprice(taxPrice);
+            purchaseDetailDTO.setPd_taxtotal(taxPrice*qty);
+            purchaseDetailDTO.setCompanyId(BaseContextHolder.getCompanyId());
+            purchaseDetailDTO.setCreatorId(BaseContextHolder.getUserId());
+            purchaseDetailDTO.setCreateTime(new Date());
+            purchaseDetailDTO.setCreatorName(BaseContextHolder.getUserName());
+            purchaseDetailDTO.setPd_puid(purchaseId);
+            purchaseDetailDTO.setPd_code(result.getData());
+            listPurchaseDetail.add(purchaseDetailDTO);
+        }
+
+        saleMapper.turnPurchaseDetail(listPurchaseDetail);
+
+
+
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setCode(result.getData());
+        baseDTO.setId(Long.valueOf(String.valueOf(purchaseId)));
+        baseDTO.setName(BillCodeSeq.PURCHASE.getName());
+        return baseDTO;
+    }
+
     //更新最新销售总额
     private void updateTotal(Long id) {
         if (null == id) {

+ 242 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -421,4 +421,246 @@
   <update id="updateCreator">
     update sale set creatorId = #{userId} , creatorName=#{userName} where sa_id=#{id}
   </update>
+  
+  
+  
+  <!-- 销售订单转采购单-->
+  <insert id="turnPurchase" parameterType="com.usoftchina.saas.sale.dto.PurchaseDTO" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into purchase
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="pu_code != null" >
+        pu_code,
+      </if>
+      <if test="pu_date != null" >
+        pu_date,
+      </if>
+      <if test="pu_vendid != null" >
+        pu_vendid,
+      </if>
+      <if test="pu_vendcode != null" >
+        PU_VENDCODE,
+      </if>
+      <if test="pu_vendname != null" >
+        PU_VENDNAME,
+      </if>
+      <if test="pu_buyerid != null" >
+        PU_BUYERID,
+      </if>
+      <if test="pu_buyercode != null" >
+        PU_BUYERCODE,
+      </if>
+      <if test="pu_buyername != null" >
+        PU_BUYERNAME,
+      </if>
+      <if test="pu_delivery != null" >
+        PU_DELIVERY,
+      </if>
+      <if test="pu_taxtotal != null" >
+        PU_TAXTOTAL,
+      </if>
+      <if test="pu_total != null" >
+        PU_TOTAL,
+      </if>
+      <if test="pu_remark != null" >
+        PU_REMARK,
+      </if>
+      <if test="pu_totalupper != null" >
+        PU_TOTALUPPER,
+      </if>
+      <if test="pu_printstatus != null" >
+        PU_PRINTSTATUS,
+      </if>
+      <if test="pu_printstatuscode != null" >
+        PU_PRINTSTATUSCODE,
+      </if>
+      <if test="pu_acceptstatuscode != null" >
+        PU_ACCEPTSTATUSCODE,
+      </if>
+      <if test="pu_acceptstatus != null" >
+        PU_ACCEPTSTATUS,
+      </if>
+      <if test="pu_statuscode != null" >
+        PU_STATUSCODE,
+      </if>
+      <if test="pu_status != null" >
+        PU_STATUS,
+      </if>
+      <if test="companyId != null" >
+        companyid,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updaterName != null" >
+        updaterName,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="pu_text1 != null" >
+        pu_text1,
+      </if>
+      <if test="pu_text2 != null" >
+        pu_text2,
+      </if>
+      <if test="pu_text3 != null" >
+        pu_text3,
+      </if>
+      <if test="pu_text4 != null" >
+        pu_text4,
+      </if>
+      <if test="pu_text5 != null" >
+        pu_text5,
+      </if>
+      <if test="pu_shipaddresscode != null" >
+        PU_SHIPADDRESSCODE,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="pu_code != null" >
+        #{pu_code,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_date != null" >
+        #{pu_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_vendid != null" >
+        #{pu_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_vendcode != null" >
+        #{pu_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_vendname != null" >
+        #{pu_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_buyerid != null" >
+        #{pu_buyerid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_buyercode != null" >
+        #{pu_buyercode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_buyername != null" >
+        #{pu_buyername,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_delivery != null" >
+        #{pu_delivery,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_taxtotal != null" >
+        #{pu_taxtotal,jdbcType=DOUBLE},
+      </if>
+      <if test="pu_total != null" >
+        #{pu_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pu_remark != null" >
+        #{pu_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_totalupper != null" >
+        #{pu_totalupper,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_printstatus != null" >
+        #{pu_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_printstatuscode != null" >
+        #{pu_printstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_acceptstatuscode != null" >
+        #{pu_acceptstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_acceptstatus != null" >
+        #{pu_acceptstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_statuscode != null" >
+        #{pu_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_status != null" >
+        #{pu_status,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterName != null" >
+        #{updaterName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_text1 != null" >
+        #{pu_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text2 != null" >
+        #{pu_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text3 != null" >
+        #{pu_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text4 != null" >
+        #{pu_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text5 != null" >
+        #{pu_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_shipaddresscode != null" >
+        #{pu_shipaddresscode,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+  <insert id="turnPurchaseDetail" parameterType="java.util.List" >
+    insert into purchasedetail ( PD_PUID, PD_CODE,
+    PD_DETNO, PD_PRODID, PD_PRODCODE,
+    PD_UNIT, PD_QTY, PD_PRICE,PD_TAXPRICE,
+    PD_TOTAL,PD_TAXRATE, PD_TAXTOTAL, PD_ACCEPTQTY,
+    PD_DELIVERY, PD_SALECODE, PD_SALEDETNO,
+    PD_SDID, companyId, updaterId,
+    updateTime, pd_text1, pd_text2,
+    pd_text3, pd_text4, pd_text5,
+    pd_yqty,pd_remark)
+    values
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      (
+      #{item.pd_puid,jdbcType=INTEGER}, #{item.pd_code,jdbcType=VARCHAR},
+      #{item.pd_detno,jdbcType=INTEGER}, #{item.pd_prodid,jdbcType=INTEGER}, #{item.pd_prodcode,jdbcType=VARCHAR},
+      #{item.pd_unit,jdbcType=VARCHAR}, #{item.pd_qty,jdbcType=DOUBLE}, #{item.pd_price,jdbcType=DOUBLE},#{item.pd_taxprice,jdbcType=DOUBLE},
+      #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE}, #{item.pd_taxtotal,jdbcType=DOUBLE}, #{item.pd_acceptqty,jdbcType=DOUBLE},
+      #{item.pd_delivery,jdbcType=DOUBLE}, #{item.pd_salecode,jdbcType=VARCHAR}, #{item.pd_saledetno,jdbcType=INTEGER},
+      #{item.pd_sdid,jdbcType=INTEGER}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.pd_text1,jdbcType=VARCHAR}, #{item.pd_text2,jdbcType=VARCHAR},
+      #{item.pd_text3,jdbcType=VARCHAR}, #{item.pd_text4,jdbcType=VARCHAR}, #{item.pd_text5,jdbcType=VARCHAR},
+      #{item.pd_yqty,jdbcType=DOUBLE}, #{item.pd_remark,jdbcType=VARCHAR}
+      )
+    </foreach>
+  </insert>
+  <select id="selectPurchaseId" resultType="int">
+    select pu_id from purchase where
+    <if test="code !=null">
+      pu_code=#{code}
+    </if> and
+    <if test="companyid !=null">
+      companyid=#{companyid}
+    </if>
+
+  </select>
 </mapper>

+ 2 - 2
base-servers/account/account-server/src/main/resources/mapper/AccountRoleMapper.xml

@@ -20,8 +20,8 @@
         SELECT a.id id,a.username,a.realname,a.email,a.mobile,GROUP_CONCAT(c.name) roleNames,GROUP_CONCAT(c.id) roleIds
         FROM ac_account a
         left join ac_account_company d on a.id = d.account_id
-        left join ac_account_role b on a.id=b.account_id
-        left join ac_role c  on b.role_id = c.id
+        left join ac_account_role b on a.id=b.account_id and d.company_id = b.company_id
+        left join ac_role c  on b.role_id = c.id and b.company_id = c.company_id
         <where>
             <if test="condition!=null">
                 ${condition}

+ 1 - 0
frontend/saas-web/app/view/auth/CompanyPicker.scss

@@ -18,6 +18,7 @@
         overflow: hidden;
         border-top: 1px solid transparent;
         cursor: pointer;
+        border-radius: 4px;
 
         img {
             margin-bottom: 10px;

+ 2 - 1
frontend/saas-web/app/view/auth/LoginController.js

@@ -65,7 +65,8 @@ Ext.define('saas.view.auth.LoginController', {
             })
             .then(function() {
                 view.isMasked() && view.unmask();
+                view.close();
                 view.ownerCt.destroy();
-            });        
+            });
     }
 });

+ 6 - 3
frontend/saas-web/app/view/core/base/BasePanel.js

@@ -28,7 +28,8 @@ Ext.define('saas.view.core.base.BasePanel', {
     searchField:[],
     gridColumns: [],
 
-    _deleteMsg: '是否删除所选单据?',
+    deleteMoreMsg: '确认删除所选单据?',
+    deleteOneMsg: '确认删除该单据?',
 
     initComponent: function() {
 
@@ -38,7 +39,8 @@ Ext.define('saas.view.core.base.BasePanel', {
         gridIdField = gridConfig.idField,
         gridCodeField = gridConfig.codeField,
         gridStatusCodeField = gridConfig.statusCodeField,
-        gridColumns = gridConfig.columns;
+        gridColumns = gridConfig.columns,
+        deleteMsg = gridConfig.deleteMsg;
 
         Ext.apply(me, {
             dockedItems: [{
@@ -65,7 +67,8 @@ Ext.define('saas.view.core.base.BasePanel', {
                 idField: gridIdField,
                 codeField: gridCodeField,
                 columns: gridColumns,
-                statusCodeField : gridStatusCodeField
+                statusCodeField : gridStatusCodeField,
+                deleteMsg: deleteMsg
             }]
         });
         me.callParent(arguments);

+ 29 - 18
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -123,11 +123,17 @@ Ext.define('saas.view.core.base.GridPanel', {
                         text: '删除',
                         handler: function(){
                             var form = this.ownerCt.ownerCt.ownerCt;
-                            saas.util.BaseUtil.deleteWarn(form._deleteMsg,function(btn){
-                                if(btn == 'yes'){
-                                    me.onVastDeal(form._batchDeleteUrl);
-                                }
-                            });
+
+                            var data = me.getGridSelected(form._batchDeleteUrl);
+                            if(data && data.length > 0) {
+                                saas.util.BaseUtil.deleteWarn(form.deleteMoreMsg,function(btn){
+                                    if(btn == 'yes'){
+                                        me.onVastDeal(form._batchDeleteUrl);
+                                    }
+                                });
+                            }else {
+                                saas.util.BaseUtil.showToast('请至少选择一条明细');
+                            }
                         }
                     }, {
                         text: '刷新',
@@ -199,20 +205,25 @@ Ext.define('saas.view.core.base.GridPanel', {
                 //删除
                 var id = record.get('id');
                 if(id){
-                    saas.util.BaseUtil.request({
-                        url: form._deleteUrl+id,
-                        method: 'POST',
-                    })
-                    .then(function(localJson) {
-                        if(localJson.success){
-                            //解析参数
-                            saas.util.BaseUtil.showToast('删除成功');
-                            view.ownerCt.store.load();
+                    saas.util.BaseUtil.showConfirm('警告', form.deleteOneMsg)
+                    .then(function(yes) {
+                        if(yes == 'yes') {
+                            saas.util.BaseUtil.request({
+                                url: form._deleteUrl+id,
+                                method: 'POST',
+                            })
+                            .then(function(localJson) {
+                                if(localJson.success){
+                                    //解析参数
+                                    saas.util.BaseUtil.showToast('删除成功');
+                                    view.ownerCt.store.load();
+                                }
+                            })
+                            .catch(function(res) {
+                                console.error(res);
+                                saas.util.BaseUtil.showToast('删除失败: ' + res.message);
+                            });
                         }
-                    })
-                    .catch(function(res) {
-                        console.error(res);
-                        saas.util.BaseUtil.showToast('删除失败: ' + res.message);
                     });
                 }
             }

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

@@ -26,7 +26,7 @@ Ext.define('saas.view.core.dbfind.types.BankInfoDbfindTrigger', {
         text: "账户ID",
         flex: 0,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: ""
     }, {
         text: "资金账户",

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

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         conditionCode: 'id',
         text: "客户ID",
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "",
     }, {
         conditionCode: 'cu_code',

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

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.EmployeeDbfindTrigger', {
         text: "人员ID",
         hidden: true,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "numbercolumn"
     },{
         text: "人员编号",

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

@@ -78,7 +78,7 @@ Ext.define('saas.view.core.dbfind.types.ProductMultiDbfindTrigger', {
         dataIndex: "pr_purcprice",
         align: 'end',
         xtype: 'numbercolumn',
-        width: 0,
+        hidden:true,
     }, {
         text: "仓库id",
         dataIndex: "pr_whid",

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

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
         text: "仓库ID",
         flex: 0,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "",
     }, {
         text: "仓库编号",

+ 7 - 4
frontend/saas-web/app/view/core/form/DataMultiCombo.js

@@ -123,9 +123,10 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
     setValue: function(items) {
         var me = this, rawV = '',
         datas = me.datas,
-        menu = me.menu;
+        menu = me.menu,
+        items = items==null?[]:items;
         if(!Ext.isArray(items)) {
-            if(items.indexOf(',')>0){
+            if(items&&items.indexOf(',')>0){
                 items = items.split(',')
             }else{
                 items = [items]
@@ -183,8 +184,10 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
     hideMenu: function(b) {
         if (this.hasVisibleMenu()) {
             var target=b.parentEvent.relatedTarget;
-            if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){
-                this.menu.hide();
+            if(target){
+                if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){
+                    this.menu.hide();
+                }
             }
         }
         return this;

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

@@ -100,7 +100,7 @@ Ext.define('saas.view.core.form.FormPanel', {
             text:'打印',
             hidden: true,
             bind: {
-                // hidden: '{!id}'
+                hidden: '{!showPrintBtn || !id}'
             },
             handler:"onPrint"
         }, {

+ 30 - 1
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -368,6 +368,35 @@ Ext.define('saas.view.core.form.FormPanelController', {
     },
 
     onPrint: function() {
-        console.log('print');
+        var me = this,
+        form = me.getView(),
+        viewModel = me.getViewModel(),
+        caller = form.caller,
+        id = viewModel.get(form._idField);
+
+        saas.util.BaseUtil.request({
+            url: '/api/commons/jasperReport/printByDefault',
+            // url: 'http://192.168.253.58:8920/jasperReport/printByDefault',
+            method: 'POST',
+            headers: {
+                "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
+            },
+            params: {
+                caller: caller,
+                id: id
+            }
+        }).then(function(res) {
+            var data = res.data,
+            printurl = data.printurl,
+            printtype = data.printtype,
+            reportName = data.reportName,
+            title = data.title,
+            whereCondition = data.whereCondition,
+            companyId = saas.util.BaseUtil.getCurrentUser().companyId;
+
+            var url = printurl + '?' + 'reportName=' + reportName + '&' + 'companyId=' + companyId + '&whereCondition=' + whereCondition
+
+            window.open(url);
+        });
     },
 });

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

@@ -11,6 +11,7 @@ Ext.define('saas.view.core.form.FormPanelModel', {
             codeEditable: false, // 单据编号是否可编辑
         },
         auditBtnText: '审核', // 审核按钮默认text
+        showPrintBtn: false, // 显示打印按钮
         showAuditBtn: true, // 显示审核、反审核按钮
         detailBindeFields: [], // 从表绑定列
         detailStore: null, // 从表store

+ 3 - 0
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -5,6 +5,9 @@ Ext.define('saas.view.document.customer.BasePanel', {
     controller: 'document-customer-basepanel',
     viewModel: 'document-customer-basepanel',
 
+    deleteMoreMsg: '删除的客户资料将不能恢复,请确认是否删除?',
+    deleteOneMsg: '删除的客户资料将不能恢复,请确认是否删除?',
+
     searchField:[{
         xtype:'customerDbfindTrigger',
         name : "cu_code", 

+ 0 - 77
frontend/saas-web/app/view/document/employee/BasePanel.js

@@ -1,77 +0,0 @@
-Ext.define('saas.view.document.employee.BasePanel', {
-    extend: 'saas.view.core.base.BasePanel',
-    xtype: 'document-employee-basepanel',
-
-    controller: 'document-employee-basepanel',
-    viewModel: 'document-employee-basepanel',
-
-    searchField:[{ 
-        xtype : "textfield", 
-        name : "em_code", 
-        emptyText : "账号", 
-        width:120
-    },{
-        xtype : "textfield", 
-        name : "em_name", 
-        emptyText : "姓名", 
-        width:120
-    },{
-        xtype : "textfield", 
-        name : "em_class", 
-        emptyText : "类型",    
-        width:100
-    },{
-        xtype : "textfield", 
-        name : "name", 
-        emptyText : "角色",    
-        width:100
-    }],
-
-    //字段属性
-    _formXtype:'document-employee-formpanel',
-    _title:'人员资料',
-    _deleteUrl:'/api/document/employee/delete/',
-
-    gridConfig: {
-        idField: 'id',
-        codeField: 'pr_code',
-        statusCodeField:'pr_statuscode',
-        dataUrl: '/api/document/employee/list',
-        columns : [{
-            text : "id", 
-            width : 0, 
-            dataIndex : "id", 
-            xtype : "numbercolumn", 
-        },{
-            text : "账号", 
-            width : 200.0, 
-            dataIndex : "em_code", 
-        }, 
-        {
-            text : "姓名", 
-            dataIndex : "em_name", 
-            width : 180.0, 
-        },
-        {
-            text : "密码", 
-            dataIndex : "em_password", 
-            width : 180.0, 
-        }, 
-        {
-            text : "类型", 
-            dataIndex : "em_class", 
-            width : 120.0, 
-            hidden : true,
-        }, 
-        {
-            text : "电话", 
-            dataIndex : "em_mobile", 
-            width : 120.0,
-        }]
-    },
-
-    refresh:function(){
-        this.items.items[0].store.load()
-    }
-
-});

+ 0 - 10
frontend/saas-web/app/view/document/employee/BasePanelController.js

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

+ 0 - 4
frontend/saas-web/app/view/document/employee/BasePanelModel.js

@@ -1,4 +0,0 @@
-Ext.define('saas.view.document.employee.BasePanelModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.document-employee-basepanel'
-});

+ 0 - 60
frontend/saas-web/app/view/document/employee/FormController.js

@@ -1,60 +0,0 @@
-Ext.define('saas.view.document.employee.FormController', {
-    extend: 'saas.view.core.form.FormPanelController',
-    alias: 'controller.document-employee-formpanel',
-
-    auditBtnClick: function() {
-        var me = this,
-        form = me.getView(),
-        statusCodeField = form._statusCodeField,
-        viewModel = me.getViewModel(),
-        status = viewModel.data[statusCodeField];
-        status == 'OPEN' ? me.unAudit() : me.audit();
-    },
-
-    audit: function(){
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel();
-        
-        saas.util.BaseUtil.request({
-            url: form._openUrl+'/'+viewModel.data.id,
-            params: '',
-            method: 'POST',
-        })
-        .then(function(localJson) {
-            if(localJson.success){
-                form.initId = localJson.data.id;
-                saas.util.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
-                saas.util.BaseUtil.showToast('启用成功');
-            }
-        })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showToast('启用失败: ' + res.message);
-        });
-    },
-    unAudit: function() {
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel();
-        
-        saas.util.BaseUtil.request({
-            url: form._closeUrl+'/'+viewModel.data.id,
-            params: '',
-            method: 'POST',
-        })
-        .then(function(localJson) {
-            if(localJson.success){
-                form.initId = localJson.data.id;
-                saas.util.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
-                saas.util.BaseUtil.showToast('禁用成功');
-            }
-        })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showToast('禁用失败: ' + res.message);
-        });
-    }
-});

+ 0 - 8
frontend/saas-web/app/view/document/employee/FormModel.js

@@ -1,8 +0,0 @@
-Ext.define('saas.view.document.employee.FormModel', {
-    extend: 'saas.view.core.form.FormPanelModel',
-    alias: 'viewmodel.document-employee-formpanel',
-
-    data: {
-        showAuditBtn:false
-    }
-});

+ 0 - 74
frontend/saas-web/app/view/document/employee/FormPanel.js

@@ -1,74 +0,0 @@
-Ext.define('saas.view.document.employee.FormPanel', {
-    extend: 'saas.view.core.form.FormPanel',
-    xtype: 'document-employee-formpanel',
-    controller: 'document-employee-formpanel',
-    viewModel: 'document-employee-formpanel',
-    caller:'Employee',
-    //字段属性
-    _title:'物料资料',
-    _idField: 'id',
-    _codeField: 'em_code',
-    _readUrl:'/api/document/employee/read/',
-    _saveUrl:'/api/document/employee/save',
-    _deleteUrl:'/api/document/employee/delete/',
-    _deleteMsg:'删除的人员资料将不能恢复,请确认是否删除?',
-    initId:0,
-    codeInHeader: false,
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_code',
-        fieldLabel: '账号',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_name',
-        fieldLabel: '姓名',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_password',
-        fieldLabel: '密码',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'combobox',
-        name: 'em_class',
-        columnWidth: 0.25,
-        fieldLabel: '类型',
-        queryMode: 'local',
-        displayField: 'name',
-        valueField: 'value',
-        allowBlank:false,
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['name', 'value'],
-            data: [
-                ["正式", "正式"],
-                ["离职", "离职"],
-            ]
-        })
-    },{
-        xtype: 'textfield',
-        name: 'em_mobile',
-        fieldLabel: '电话',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_email',
-        fieldLabel: '邮箱',
-        // allowBlank: false,
-        columnWidth: 0.25
-    }],
-    auditTexts: {
-
-    }
-});

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

@@ -229,8 +229,9 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 dataUrl:'/api/account/role/list',
                 fieldLabel: '关联角色',
                 name: 'roleNames',
-                allowBlank:false,
-                maxLength: 20
+                allowBlank:true,
+                maxLength: 20,
+                beforeLabelTextTpl: "",
             },{
                 xtype:'textfield',
                 fieldLabel: '联系电话',
@@ -273,7 +274,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 name: 'wh_type',
                 allowBlank:false,
                 displayField : "display", 
-                editable:true,
+                editable:false,
                 hideTrigger : false, 
                 maxLength : 100.0, 
                 minValue : null, 
@@ -301,6 +302,57 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 value:'OPEN'
             }]
         },
+        employee:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员编号',
+                name: 'em_code',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员名称',
+                name: 'em_name',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '联系电话',
+                name: 'em_mobile',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '邮箱',
+                name: 'em_email', 
+                allowBlank:false,  
+                maxLength: 20
+            },{
+                value:'正式',
+                xtype:'combo',
+                fieldLabel: '人员状态',
+                name: 'em_class',
+                allowBlank:false,
+                displayField : "display", 
+                editable:false,
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"正式", "value":'正式'},
+                        {"display":"离职", "value":'离职'}
+                    ]
+                }
+            },]
+        },
         maxnumbers:{
             items:[{
                 xtype:'hidden',
@@ -464,6 +516,10 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         });
         o = o.substring(0,o.length-1);
 
+        if(o==""){
+            saas.util.BaseUtil.showToast('关联角色未选择,无法保存!')
+        }
+
         var _params = {
             accountId:Number(params['accountId']),
             roleIds:o,

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

@@ -258,6 +258,66 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             reqUrl:'/api/account/account/bind/roles',
         },
+        employee:{
+            columns: [{
+                text: '人员编号',
+                dataIndex: 'em_code',
+                width: 200
+            },{
+                text: '人员名称',
+                dataIndex: 'em_name',
+                width: 200
+            },{
+                text: '联系电话',
+                dataIndex: 'em_mobile',
+                width: 200
+            },{  
+                text: '邮箱',
+                dataIndex: 'em_email',
+                width: 200
+            },{
+                text: '人员状态',
+                dataIndex: 'em_class',
+                width:90,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('em_class')=='正式'){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('em_class')=='正式'?true:false;
+                        //  禁用/启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                            params: '',
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/employee/save',
+            delUrl: '/api/document/employee/delete'
+        },
         warehouse:{
             columns: [{
                 text: '编号',

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

@@ -263,6 +263,36 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
+        employee:{
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'em_code',  type: 'string'},
+                {name: 'em_mobile',  type: 'string'},
+                {name: 'em_email',  type: 'string'},
+                {name: 'em_clasee',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/employee/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list'
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        },
         productunit: {    
             fields:[
                 {name: 'id', type: 'int'},

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

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

+ 2 - 1
frontend/saas-web/app/view/document/product/FormModel.js

@@ -18,7 +18,8 @@ Ext.define('saas.view.document.product.FormModel', {
             get: function(v) {
                 var form = this.getView(),
                 detailGrid = form.down('detailGridField');
-                
+                //detailGrid.allowEmpty = !v;
+                //form.isValid();
                 form.getForm().findField('qcsz').resetOriginalValue();
                 detailGrid.setHidden(!v);
             }

+ 2 - 0
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -372,6 +372,8 @@ Ext.define('saas.view.document.product.FormPanel', {
             trueData = detailGrid.getTrueData();
 
             viewModel.set('qcsz', trueData.length > 0);
+            viewModel.notify();
+            form.getForm().findField('qcsz').resetOriginalValue();
         }
     }
 });

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

@@ -66,34 +66,37 @@ Ext.define('saas.view.main.Main', {
                 },
                 {
                     iconCls:'x-fa fa-question',
+                    cls:'sa-nav-button',
                     ui: 'header',
                     arrowVisible: false,
                     tooltip: '帮助',
                     width:50, 
+                    height:45,
                     menu: {
-                        cls:'x-main-menu',
+                        cls:'x-main-menu sa-nav-menu',
                         items: [{
                             text: '新手导航',
-                            iconCls:'x-fa fa-comment-o',
+                            iconCls:'x-fa fa-comment-o sa-navicon',
                             handler:function(){
                                saas.util.BaseUtil.openTab('sys-guide-formpanel','新手导航', 'sys-guide-formpanel-nav');
                             }
                         },{
                             text: '用户手册',
-                            iconCls:'x-fa fa-comment-o',
+                            iconCls:'x-fa fa-address-book-o sa-navicon',
                             handler:function(){
                                 window.open('http://www.usoftchina.com','_blank');
                             }
                         },{
                             text: '常见问题',
-                            iconCls:'x-fa fa-question-circle-o',
+                            iconCls:'x-fa fa-question-circle-o sa-navicon',
                             handler:function(){
                                 window.open('http://www.usoftchina.com','_blank');
                             }
                         },{
                             text: '客服热线',
-                            iconCls:'x-fa fa-comment-o',
+                            iconCls:'x-fa fa-comment-o sa-navicon',
                             menu:{
+                                cls:'sa-nav-menu',
                                 items:[{
                                     text:'<span onclick="javascript:window.open(\'http://www.usoftchina.com\');" style="text-decoration:underline;color:blue;">优软科技官网</span>'
                                 },{	
@@ -127,20 +130,20 @@ Ext.define('saas.view.main.Main', {
                         html:'<img class="x-img x-box-item x-toolbar-item x-img-header" style="height:35px;width:35px;margin-top: 6px;margin-left: 14px;" src="{avatarUrl}" alt="">'
                     }, 
                     menu: {
-                        cls:'x-main-menu2',
+                        cls:'x-main-menu2 sa-nav-menu', 
                         items: [ {  
                             text: '账户中心',
-                            iconCls:'x-fa x-fa fa-user-o',
+                            iconCls:'x-fa fa-user-o sa-navicon',
                             handler:function(){
                                 window.open('http://www.usoftchina.com','_blank');
                             }
                         },{  
                             text: '意见反馈',
-                            iconCls:'x-fa fa-comment-o',
+                            iconCls:'x-fa fa-comment-o sa-navicon',
                             handler:'feedbackMsg'
                         }, {
                             text: '退出',
-                            iconCls:'x-fa fa-power-off',
+                            iconCls:'x-fa fa-power-off sa-navicon',
                             handler: 'onLogout'
                         }]
                     }

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

@@ -221,54 +221,64 @@ body > .x-mask {
     filter: grayscale(100%);
     filter: gray;
 }
- .x-main-menu{
+ .sa-nav-menu{
     background: #f8fbff;
-    border: 2px solid #34baf6;
+    border: 1px solid #34baf6;
+    margin-top: 10px;
  }
- .x-main-menu .x-menu-item-text-default{
-    font-family: PingFangSC-Regular;
+ .sa-nav-button{
+    box-shadow: none !important;
+ }
+ .sa-nav-menu.x-menu-item-text-default,
+ .sa-nav-menu  .sa-navicon {
+    //font-family: PingFangSC-Regular;
     //font-size: 14px;
     color: #34BAF6;
     letter-spacing: 0;
     text-align: center;
  }
+ .x-menu.sa-nav-menu .x-menu-bodyWrap{
+    margin-left: -0.5px;
+ }
+/* .x-main-menu .x-fa.sa-navicon{
+    color: #34BAF6;
+}  */
+.sa-nav-menu .x-menu-item.x-menu-item-default-focus  .x-menu-item-text-default ,
+.sa-nav-menu .x-menu-item.x-menu-item-active  .x-menu-item-text-default,
+.sa-nav-menu .x-menu-item.x-menu-item-default-focus  .sa-navicon ,
+.sa-nav-menu .x-menu-item.x-menu-item-active  .sa-navicon{
+    color: white;
+}
+
 .x-main-menu::before{
     content: ' ';
     display: block;
     border-style: solid;
-    background-color: white;
+    background-color: #f8fbff;
     transform: rotate(45deg);
-    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(15, 136, 232, 0.6);
-    box-shadow: aliceblue;
-    border-width: 2px;
-    border-color: #34BAF6;
-    /* border-color: #cccccc #6e838e #9c9d9e #bdc3c5; */
+    border-color: #34baf6;
     position: fixed;
-    width: 14px;
-    height: 14px;
-    /* left: 100%; */
-    top: 25px;
-    -moz-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
-    /* -webkit-clip-path: polygon(100% 0px, 0 50%, 100% 100%); */
-    -o-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
-    -ms-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
-    -khtml-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
-    clip-path: polygon(0% 0,100% 0%,0 100%);
-    margin-top: 17px;
-    margin-left: 7px;
-    z-index: 99;
+    width: 15px;
+    height: 15px;
+    clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -moz-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -webkit-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -o-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -ms-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -khtml-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    border-width: 1px 0px 0px 1px !important;
+    margin-top: -7.5px;
+    margin-left: 16px;
 }
 .x-main-menu2::before{
-    content: ' ';
+    /* content: ' ';
     display: block;
     border-style: solid;
     box-shadow: 0px 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(15, 136, 232, 0.6);
     box-shadow: aliceblue;
     border-width: 17px;
     border-color: #cccccc;
-    /* border-color: #cccccc #6e838e #9c9d9e #bdc3c5; */
     position: fixed;
-    /* left: 100%; */
     top: 26px;
     -moz-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
     -webkit-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
@@ -277,5 +287,24 @@ body > .x-mask {
     -khtml-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
     clip-path: polygon(0 100%, 50% 0, 100% 100%);
     margin-top: 25px;
-    margin-left: 47px;
+    margin-left: 47px; */
+
+    content: ' ';
+    display: block;
+    border-style: solid;
+    background-color: #f8fbff;
+    transform: rotate(45deg);
+    border-color: #34baf6;
+    position: fixed;
+    width: 15px;
+    height: 15px;
+    clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -moz-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -webkit-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -o-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -ms-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -khtml-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    border-width: 1px 0px 0px 1px !important;
+    margin-top: -7.5px;
+    margin-left: 55px;
 }

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

@@ -121,13 +121,12 @@ Ext.define('saas.view.main.MainController', {
                 modal: true,
                 id:"feedbackWin",
                 height: '50%',
-                width: '50%',
+                width: '70%',
                 title: '意见反馈',
                 scrollable: true,
                 constrain: true,
                 closable: true,
                 layout: 'fit',
-
                 items: [{
                     xtype: 'sys-feedback-formpanel'
                 }]

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

@@ -44,7 +44,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间", 
                 dataIndex : "ftd_ym", 

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

@@ -32,7 +32,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                         },{
                             from:'id',to:'ftd_inbankid',ignore:true
                         },{
-                            from:'bk_inthisamount',to:'bk_inthisamount'
+                            from:'bk_thisamount',to:'bk_inthisamount'
                         }],
                     }) ;   
 

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

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

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

@@ -70,7 +70,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间",
                 dataIndex : "ord_ym",

+ 3 - 0
frontend/saas-web/app/view/money/othreceipts/FormPanelModel.js

@@ -2,4 +2,7 @@ Ext.define('saas.view.money.othreceipts.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.money-othreceipts-formpanel',
 
+    data: {
+        showPrintBtn: true
+    }
 });

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

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

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

@@ -70,7 +70,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间", 
                 dataIndex : "osd_ym", 

+ 3 - 0
frontend/saas-web/app/view/money/othspendings/FormPanelModel.js

@@ -2,4 +2,7 @@ Ext.define('saas.view.money.othspendings.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.money-othspendings-formpanel',
 
+    data: {
+        showPrintBtn: true
+    }
 });

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

@@ -89,7 +89,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -143,7 +143,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
             text: '金额',
             xtype: 'numbercolumn',
             dataIndex: 'os_amount',
-            width: 0,
+            hidden:true,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -153,7 +153,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         }, {
             text: '备注',
             dataIndex: 'os_remark',
-            width: 0
+            hidden:true
         }],
         relativeColumn: []
     }

+ 4 - 0
frontend/saas-web/app/view/money/payBalance/FormPanelModel.js

@@ -2,6 +2,10 @@ Ext.define('saas.view.money.payBalance.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.money-paybalance-formpanel',
 
+    data: {
+        showPrintBtn: true
+    },
+    
     formulas: {
         pb_vendname_change: {
             bind: '{pb_vendid}',

+ 5 - 5
frontend/saas-web/app/view/money/recBalance/QueryPanel.js

@@ -142,26 +142,26 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
         },{
             text: '源单编号',
             dataIndex: 'rbd_slcode',
-            width: 0
+            hidden:true
         },{
             text: '业务类别',
             dataIndex: 'rbd_slkind',
-            width: 0
+            hidden:true
         },{
             text: '单据日期',
             dataIndex: 'rbd_sldate',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         },{
             text: '单据金额',
             dataIndex: 'rbd_amount',
             xtype: 'numbercolumn',
-            width: 0
+            hidden:true
         },{
             text: '本次核销金额',
             dataIndex: 'rbd_nowbalance',
             xtype: 'numbercolumn',
-            width: 0
+            hidden:true
         },
         ]
     },

+ 3 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanelModel.js

@@ -2,6 +2,9 @@ Ext.define('saas.view.purchase.purchase.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.purchase-purchase-formpanel',
 
+    data: {
+        showPrintBtn: true
+    },
 
     formulas:{
         turnHidden:{

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

@@ -141,29 +141,29 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '录入人ID',
             dataIndex: 'creatorId',
-            width: 0
+            hidden:true
         }, {
             text: '录入人',
             dataIndex: 'creatorName',
-            width: 0
+            hidden:true
         }, {
             text: '录入日期',
             dataIndex: 'createTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }, {
             text: '更新人ID',
             dataIndex: 'updaterId',
-            width: 0
+            hidden:true
         }, {
             text: '更新人',
             dataIndex: 'updater',
-            width: 0
+            hidden:true
         }, {
             text: '更新日期',
             dataIndex: 'updateTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }],
         relativeColumn: [
         {

+ 10 - 8
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelModel.js

@@ -1,15 +1,17 @@
 Ext.define('saas.view.purchase.purchaseIn.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.purchase-purchasein-formpanel',
-    
+
     data: {
-        pi_class: '采购验收单'
-     },
-     formulas:{
-        turnHidden:{
-            bind:'{pi_statuscode}',
-            get:function(value){
-                return value!='AUDITED';
+        pi_class: '采购验收单',
+        showPrintBtn: true
+    },
+
+    formulas: {
+        turnHidden: {
+            bind: '{pi_statuscode}',
+            get: function (value) {
+                return value != 'AUDITED';
             }
         }
     }

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

@@ -130,25 +130,25 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         },{
             text: '录入人ID',
             dataIndex: 'creatorId',
-            width: 0
+            hidden:true
         }, {
             text: '录入日期',
             dataIndex: 'createTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }, {
             text: '更新人ID',
             dataIndex: 'updaterId',
-            width: 0
+            hidden:true
         }, {
             text: '更新人',
             dataIndex: 'updaterName',
-            width: 0
+            hidden:true
         }, {
             text: '更新日期',
             dataIndex: 'updateTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }],
         relativeColumn: [{
             text: 'id',

+ 4 - 3
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelModel.js

@@ -1,8 +1,9 @@
 Ext.define('saas.view.purchase.purchaseOut.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.purchase-purchaseout-formpanel',
-    
+
     data: {
-        pi_class: '采购验退单'
-     }
+        pi_class: '采购验退单',
+        showPrintBtn: true
+    }
 });

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

@@ -21,7 +21,8 @@ Ext.define('saas.view.sale.sale.FormPanel', {
      _auditUrl:'/api/sale/sale/audit/',
      _unAuditUrl: '/api/sale/sale/unAudit/',
      _deleteUrl:'/api/sale/sale/delete/',
-     _turnOutUrl:'/api/sale/sale/turnProdOut/', 
+     _turnOutUrl:'/api/sale/sale/turnProdOut/',
+     _turnPurchase:'/api/sale/sale/saleTurnPurchase/',
      initId:0,
  
      toolBtns: [{
@@ -32,6 +33,14 @@ Ext.define('saas.view.sale.sale.FormPanel', {
          bind: {
              hidden: '{sa_statuscode!="AUDITED"}'
          }
+     },{
+         xtype: 'button',
+         text: '转采购单',
+         hidden: true,
+         handler: 'turnPurchase',
+         bind: {
+             hidden: '{sa_statuscode!="AUDITED"}'
+         }
      }],
 
     defaultItems: [{
@@ -89,7 +98,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "sd_prodid", 

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

@@ -82,5 +82,30 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
             console.error(res);
             saas.util.BaseUtil.showToast('转单失败: ' + res.message);
         });
-     }
+     },
+    turnPurchase : function(){
+        var me = this,
+            form = me.getView(),
+            id = form.getForm().findField(form._idField);
+        saas.util.BaseUtil.request({
+            url: form._turnPurchase+id.value,
+            method: 'POST',
+        })
+            .then(function(localJson) {
+                if(localJson.success){
+                    var intValue = localJson.data.id,
+                        codeValue= localJson.data.code,
+                        name = localJson.data.name;
+                    saas.util.BaseUtil.openTab('purchase-purchase-formpanel',name+"("+codeValue+")",codeValue+intValue, {
+                        initId: intValue
+                    });
+                    saas.util.BaseUtil.showToast('转单成功');
+                    saas.util.FormUtil.loadData(form);
+                }
+            })
+            .catch(function(res) {
+                console.error(res);
+                saas.util.BaseUtil.showToast('转单失败: ' + res.message);
+            });
+    }
 });

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

@@ -1,4 +1,8 @@
 Ext.define('saas.view.sale.sale.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.sale-sale-formpanel',
+
+    data: {
+        showPrintBtn: true
+    }
 });

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

@@ -87,7 +87,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'sa_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '销售单号',
@@ -145,7 +145,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         relativeColumn: [ {
             text: 'id',
             dataIndex: 'sa_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

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

@@ -72,7 +72,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "pd_prodid", 

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

@@ -1,4 +1,8 @@
 Ext.define('saas.view.sale.saleIn.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.sale-salein-formpanel',
+
+    data: {
+        showPrintBtn: true
+    }
 });

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

@@ -74,7 +74,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -125,7 +125,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         relativeColumn: [{
             text: 'id',
             dataIndex: 'pu_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

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

@@ -81,7 +81,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "pd_prodid", 

+ 4 - 0
frontend/saas-web/app/view/sale/saleOut/FormPanelModel.js

@@ -2,4 +2,8 @@ Ext.define('saas.view.sale.saleout.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.sale-saleout-formpanel',
 
+    data: {
+        showPrintBtn: true
+    }
+
 });

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

@@ -76,7 +76,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -122,7 +122,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         relativeColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

+ 3 - 2
frontend/saas-web/app/view/stock/otherIn/FormPanelModel.js

@@ -3,6 +3,7 @@ Ext.define('saas.view.stock.otherIn.FormPanelModel', {
     alias: 'viewmodel.stock-otherin-formpanel',
     
     data: {
-        pi_class: '其它入库单'
-     }
+        pi_class: '其它入库单',
+        showPrintBtn: true
+    }
 });

+ 3 - 2
frontend/saas-web/app/view/stock/otherOut/FormPanelModel.js

@@ -3,6 +3,7 @@ Ext.define('saas.view.stock.otherOut.FormPanelModel', {
     alias: 'viewmodel.stock-otherout-formpanel',
     
     data: {
-        pi_class: '其它出库单'
-     }
+        pi_class: '其它出库单',
+        showPrintBtn: true
+    }
 });

+ 45 - 40
frontend/saas-web/app/view/sys/feedback/FormPanel.js

@@ -14,47 +14,52 @@ Ext.define('saas.view.sys.feedback.FormPanel', {
     fieldDefaults: {
         margin: '0 0 10 0',
         labelAlign: 'right',
-        labelWidth: 90,
-        columnWidth: 0.25,
+        labelWidth: 70,
+        columnWidth: 0.5,
     },
     bodyPadding: 10,
     border: false,
-
-    items: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        readOnly:true,
-        defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().id:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_name", 
-        fieldLabel : "姓名",
-        readOnly:true,
-        defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().realname:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_mobile", 
-        fieldLabel : "手机号",
-        defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().mobile:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_QQ", 
-        fieldLabel : "QQ"
-    }, {
-        xtype : "textfield", 
-        name : "fb_wechat", 
-        fieldLabel : "微信"
-    }, {
-        xtype : "html", 
-        name : "fb_msg", 
-        fieldLabel : "反馈内容",
-        flex: 1
-    }],buttons: [{
-        text: '提交',
-        handler:'onSubmit'
-    },{
-        text: '关闭',
-        handler:'onClose'
-    }]
+    initComponent: function () {
+        var me = this;
+        me.items = [{
+            xtype: 'hidden',
+            name: 'id',
+            fieldLabel: 'id',
+            readOnly:true,
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().id:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_name", 
+            fieldLabel : "姓名",
+            readOnly:true,
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().realname:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_mobile", 
+            fieldLabel : "手机号",
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().mobile:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_QQ", 
+            fieldLabel : "QQ"
+        }, {
+            xtype : "textfield", 
+            name : "fb_wechat", 
+            fieldLabel : "微信"
+        }, {
+            xtype : "htmleditor", 
+            name : "fb_msg", 
+            fieldLabel : "反馈内容",
+            columnWidth: 1
+        }];
+        me.buttons = [{
+            text: '提交',
+            handler:'onSubmit'
+        },{
+            text: '关闭',
+            handler:'onClose'
+        }];
+        me.callParent(arguments);
+    }
+    
 });

部分文件因为文件数量过多而无法显示