Explorar el Código

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java
#	applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml
zhoudw hace 7 años
padre
commit
0c45edc818
Se han modificado 61 ficheros con 901 adiciones y 224 borrados
  1. 10 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java
  2. 10 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbers.java
  3. 10 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java
  4. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java
  5. 1 0
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml
  6. 3 2
      applications/commons/commons-server/src/main/resources/mapper/MessagelogMapper.xml
  7. 3 3
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java
  8. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  9. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  10. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/FundinouttypeMapper.java
  11. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  12. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProducttypeMapper.java
  13. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java
  14. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  15. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  16. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  17. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  18. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  19. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  20. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  21. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  22. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  23. 4 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  24. 12 1
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  25. 12 1
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  26. 12 1
      applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml
  27. 12 1
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  28. 12 1
      applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml
  29. 12 1
      applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml
  30. 6 6
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  31. 12 1
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  32. 12 1
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  33. 1 1
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/CustomerServiceTest.java
  34. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java
  35. 9 8
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  36. 7 6
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  37. 4 8
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  38. 1 2
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  39. 60 35
      frontend/saas-web/app/view/core/form/FormPanel.js
  40. 0 8
      frontend/saas-web/app/view/core/form/FormPanelController.js
  41. 15 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  42. 41 3
      frontend/saas-web/app/view/core/tab/Controller.js
  43. 4 4
      frontend/saas-web/app/view/document/bom/FormController.js
  44. 32 2
      frontend/saas-web/app/view/document/bom/FormPanel.js
  45. 2 2
      frontend/saas-web/app/view/document/customer/FormController.js
  46. 31 1
      frontend/saas-web/app/view/document/customer/FormPanel.js
  47. 2 2
      frontend/saas-web/app/view/document/product/FormController.js
  48. 6 6
      frontend/saas-web/app/view/document/product/FormPanel.js
  49. 10 1
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  50. 2 2
      frontend/saas-web/app/view/document/vendor/FormController.js
  51. 6 6
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  52. 1 1
      frontend/saas-web/app/view/main/MainContainerWrap.js
  53. 66 43
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  54. 59 19
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  55. 10 3
      frontend/saas-web/app/view/money/payBalance/QueryPanel.js
  56. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  57. 108 0
      frontend/saas-web/app/view/sys/config/FormPanel.js
  58. 223 0
      frontend/saas-web/app/view/sys/config/FormPanelController.js
  59. 5 0
      frontend/saas-web/app/view/sys/config/FormPanelModel.js
  60. 8 0
      frontend/saas-web/overrides/i18n.js
  61. 5 0
      frontend/saas-web/resources/json/navigation.json

+ 10 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java

@@ -61,6 +61,16 @@ public enum  BillCodeSeq {
         return name;
     }
 
+    // 根据caller返回名称
+    public static String getName( String caller) {
+        for (BillCodeSeq bill : BillCodeSeq.values()) {
+            if (bill.getCaller().equals(caller)) {
+                return bill.name;
+            }
+        }
+        return null;
+    }
+
     public void setName(String name) {
         this.name = name;
     }

+ 10 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbers.java

@@ -9,6 +9,16 @@ public class Maxnumbers extends CommonBaseEntity{
 
     private String mn_rule;
 
+    public String getMn_name() {
+        return mn_name;
+    }
+
+    public void setMn_name(String mn_name) {
+        this.mn_name = mn_name;
+    }
+
+    private String mn_name;
+
     public String getMn_rule() {
         return mn_rule;
     }

+ 10 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java

@@ -14,8 +14,18 @@ public class Messagelog extends CommonBaseEntity{
 
     private String ml_caller;
 
+    public String getMl_name() {
+        return ml_name;
+    }
+
+    public void setMl_name(String ml_name) {
+        this.ml_name = ml_name;
+    }
+
     private String ml_man;
 
+    private String ml_name;
+
     public Long getMl_keyvalue() {
         return ml_keyvalue;
     }

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

@@ -6,6 +6,7 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.service.MessageLogService;
@@ -100,6 +101,7 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
         String language = "zh_CN";
         Messagelog msg = new Messagelog();
         msg.setMl_caller(baseDTO.getName());
+        msg.setMl_name(BillCodeSeq.getName(baseDTO.getName()));
         msg.setMl_content(getLocalMessage(operation.getTitle(), language));
         msg.setMl_result(getLocalMessage(operation.getResult(), language));
         msg.setMl_code(baseDTO.getCode());

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

@@ -6,6 +6,7 @@
     <result column="mn_caller" property="mn_caller" jdbcType="VARCHAR" />
     <result column="mn_leadcode" property="mn_leadcode" jdbcType="VARCHAR" />
     <result column="mn_number" property="mn_number" jdbcType="VARCHAR" />
+    <result column="mn_name" property="mn_name" jdbcType="VARCHAR" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
     <result column="creatorId" property="creatorId" jdbcType="INTEGER" />

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

@@ -7,6 +7,7 @@
     <result column="ml_content" property="ml_content" jdbcType="VARCHAR" />
     <result column="ml_result" property="ml_result" jdbcType="VARCHAR" />
     <result column="ml_caller" property="ml_caller" jdbcType="VARCHAR" />
+    <result column="ml_name" property="ml_name" jdbcType="VARCHAR" />
     <result column="ml_man" property="ml_man" jdbcType="VARCHAR" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
@@ -111,11 +112,11 @@
     insert into messagelog ( ml_code, ml_content,
       ml_result, ml_caller, ml_man, 
       companyId, createTime, creatorId, 
-      updateTime, updaterId,ml_keyvalue)
+      updateTime, updaterId,ml_keyvalue,ml_name)
     values (#{ml_code,jdbcType=VARCHAR}, #{ml_content,jdbcType=VARCHAR},
       #{ml_result,jdbcType=VARCHAR}, #{ml_caller,jdbcType=VARCHAR}, #{ml_man,jdbcType=VARCHAR}, 
       #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER},#{ml_keyvalue,jdbcType=INTEGER})
+      #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER},#{ml_keyvalue,jdbcType=INTEGER},#{ml_name,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
     insert into messagelog

+ 3 - 3
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java

@@ -12,7 +12,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
 
     private String vc_name;
 
-    private Integer vc_tel;
+    private Long vc_tel;
 
     private String vc_qq;
 
@@ -54,11 +54,11 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
         this.vc_name = vc_name;
     }
 
-    public Integer getVc_tel() {
+    public Long getVc_tel() {
         return vc_tel;
     }
 
-    public void setVc_tel(Integer vc_tel) {
+    public void setVc_tel(Long vc_tel) {
         this.vc_tel = vc_tel;
     }
 

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

@@ -25,7 +25,7 @@ public interface AddressMapper extends CommonBaseMapper<Address> {
 
     int deleteByIds(String ids);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -22,5 +22,5 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/FundinouttypeMapper.java

@@ -21,7 +21,7 @@ public interface FundinouttypeMapper extends CommonBaseMapper<Fundinouttype> {
 
     int updateByPrimaryKey(Fundinouttype record);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -23,5 +23,5 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -20,7 +20,7 @@ public interface ProducttypeMapper extends CommonBaseMapper<Producttype> {
 
     int updateByPrimaryKey(Producttype record);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -20,7 +20,7 @@ public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
 
     int updateByPrimaryKey(Productunit record);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -23,5 +23,5 @@ public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java

@@ -33,5 +33,5 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
 
     List<Warehouse> selectWarehouseListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
 
-    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -38,7 +38,7 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             address.setCreateTime(new Date());
             address.setCreatorId(BaseContextHolder.getUserId());
             //验证名称是否重复
-            validName(address.getAd_address());
+            validName(address.getAd_address(), address.getId());
             addressMapper.insertSelective(address);
             //记录LOG
             messageLogService.save(generateMsgObj(address.getId()));
@@ -46,7 +46,7 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             address.setUpdaterId(BaseContextHolder.getUserId());
             address.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(address.getAd_address());
+            validName(address.getAd_address(), address.getId());
             addressMapper.updateByPrimaryKeySelective(address);
             //记录LOG
             messageLogService.update(generateMsgObj(address.getId()));
@@ -93,8 +93,8 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -36,7 +36,7 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
             customerkind.setCreateTime(new Date());
             customerkind.setCreatorId(BaseContextHolder.getUserId());
             //验证名称是否重复
-            validName(customerkind.getCk_name());
+            validName(customerkind.getCk_name(), customerkind.getId());
             customerkindMapper.insertSelective(customerkind);
             //记录LOG
             messageLogService.save(generateMsgObj(customerkind.getId()));
@@ -44,7 +44,7 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
             customerkind.setUpdaterId(BaseContextHolder.getUserId());
             customerkind.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(customerkind.getCk_name());
+            validName(customerkind.getCk_name(), customerkind.getId());
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
             //记录LOG
             messageLogService.update(generateMsgObj(customerkind.getId()));
@@ -86,8 +86,8 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

+ 4 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java

@@ -35,7 +35,7 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
             fundinouttype.setCreatorId(BaseContextHolder.getUserId());
             fundinouttype.setCreateTime(new Date());
             //验证名称是否重复
-            validName(fundinouttype.getFt_name());
+            validName(fundinouttype.getFt_name(), fundinouttype.getId());
 
             getMapper().insertSelective(fundinouttype);
             //记录LOG
@@ -44,7 +44,7 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
             fundinouttype.setUpdaterId(BaseContextHolder.getUserId());
             fundinouttype.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(fundinouttype.getFt_name());
+            validName(fundinouttype.getFt_name(), fundinouttype.getId());
 
             getMapper().updateByPrimaryKeySelective(fundinouttype);
             //记录LOG
@@ -77,8 +77,8 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -34,7 +34,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             productbrand.setCreatorId(BaseContextHolder.getUserId());
             productbrand.setCreateTime(new Date());
             //验证名称是否重复
-            validName(productbrand.getPb_name());
+            validName(productbrand.getPb_name(), productbrand.getId());
 
             productbrandMapper.insertSelective(productbrand);
             //记录日志
@@ -44,7 +44,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             productbrand.setUpdaterId(BaseContextHolder.getUserId());
             productbrand.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(productbrand.getPb_name());
+            validName(productbrand.getPb_name(), productbrand.getId());
             productbrandMapper.updateByPrimaryKeySelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
@@ -72,8 +72,8 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -36,7 +36,7 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
             producttype.setCreatorId(BaseContextHolder.getUserId());
             producttype.setCreateTime(new Date());
             //验证名称是否重复
-            validName(producttype.getPt_name());
+            validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.insertSelective(producttype);
             //记录LOG
             messageLogService.save(generateMsgObj(producttype.getId()));
@@ -44,7 +44,7 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
             producttype.setUpdaterId(BaseContextHolder.getUserId());
             producttype.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(producttype.getPt_name());
+            validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.updateByPrimaryKeySelective(producttype);
             //记录LOG
             messageLogService.update(generateMsgObj(producttype.getId()));
@@ -81,8 +81,8 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -29,7 +29,7 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
             productunit.setCreatorId(BaseContextHolder.getUserId());
             productunit.setCreateTime(new Date());
             //验证名称是否重复
-            validName(productunit.getPu_name());
+            validName(productunit.getPu_name(), productunit.getId());
 
             getMapper().insertSelective(productunit);
             //记录LOG
@@ -38,7 +38,7 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
             productunit.setUpdaterId(BaseContextHolder.getUserId());
             productunit.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(productunit.getPu_name());
+            validName(productunit.getPu_name(), productunit.getId());
             getMapper().updateByPrimaryKeySelective(productunit);
             //记录LOG
             messageLogService.update(generateMsgObj(productunit.getId()));
@@ -76,8 +76,8 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -31,7 +31,7 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
             vendorkind.setCreatorId(BaseContextHolder.getUserId());
             vendorkind.setCreateTime(new Date());
             //验证名称是否重复
-            validName(vendorkind.getVk_name());
+            validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.insertSelective(vendorkind);
             //记录LOG
             messageLogService.save(generateMsgObj(vendorkind.getId()));
@@ -39,7 +39,7 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
             vendorkind.setUpdaterId(BaseContextHolder.getUserId());
             vendorkind.setUpdateTime(new Date());
             //验证名称是否重复
-            validName(vendorkind.getVk_name());
+            validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.updateByPrimaryKeySelective(vendorkind);
             //记录LOG
             messageLogService.update(generateMsgObj(vendorkind.getId()));
@@ -76,8 +76,8 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

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

@@ -108,7 +108,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             record.setCreateTime(new Date());
 
             //验证名称是否重复
-            validName(record.getWh_description());
+            validName(record.getWh_description(), record.getId());
             count = getMapper().insertSelective(record);
             //记录LOG
             docBaseDTO = generateMsgObj(record.getId(), code);
@@ -117,7 +117,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             record.setUpdateTime(new Date());
             record.setUpdaterId(BaseContextHolder.getUserId());
             //验证名称是否重复
-            validName(record.getWh_description());
+            validName(record.getWh_description(), record.getId());
 
             getMapper().updateByPrimaryKeySelective(record);
             //记录LOG
@@ -231,8 +231,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
      * @param name
      * @return
      */
-    private boolean validName(String name){
-        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
         if (count > 0){
             throw new BizException(BizExceptionCode.REPEAT_NAME);
         }

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/AddressMapper.xml

@@ -182,7 +182,18 @@
     SELECT * FROM ADDRESS
   </select>
   <select id="selectCountByName" resultType="int">
-    SELECT count(*) FROM ADDRESS WHERE AD_ADDRESS=#{name} AND COMPANYID=#{companyId}
+    SELECT count(*) FROM ADDRESS
+    <where>
+        <if test="name!=null">
+           and ad_address=#{name}
+        </if>
+        <if test="companyId!=null">
+           and companyId=#{companyId}
+        </if>
+        <if test="id!=null and id!=0">
+            and ad_id!=#{id}
+        </if>
+    </where>
   </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml

@@ -126,6 +126,17 @@
     SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
   </select>
     <select id="selectCountByName" resultType="int">
-        SELECT count(*) FROM CUSTOMERKIND WHERE CK_NAME=#{name} AND COMPANYID=#{companyId}
+        SELECT count(*) FROM CUSTOMERKIND
+        <where>
+            <if test="name!=null">
+                and CK_NAME=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and companyId=#{companyId}
+            </if>
+            <if test="id!=0 and id != null">
+                and ck_id != #{id}
+            </if>
+        </where>
     </select>
 </mapper>

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml

@@ -143,7 +143,18 @@
     SELECT * FROM FUNDINOUTTYPE
   </select>
   <select id="selectCountByName" resultType="int">
-    SELECT COUNT(*) FROM FUNDINOUTTYPE WHERE FT_NAME=#{name} AND COMPANYID=#{companyId}
+    SELECT COUNT(*) FROM FUNDINOUTTYPE
+    <where>
+        <if test="name!=null">
+            and FT_NAME=#{name}
+        </if>
+        <if test="companyId!=null and companyId!=0">
+            and COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and ft_id != #{id}
+        </if>
+    </where>
   </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT FT_NAME display,FT_NAME value FROM FUNDINOUTTYPE

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml

@@ -133,6 +133,17 @@
     SELECT PB_NAME display,PB_NAME value FROM PRODUCTBRAND
   </select>
   <select id="selectCountByName" resultType="int">
-    SELECT COUNT(*) FROM PRODUCTBRAND WHERE PB_NAME=#{name} AND COMPANYID=#{companyId}
+    SELECT COUNT(*) FROM PRODUCTBRAND
+    <where>
+        <if test="name!=null">
+            and PB_NAME=#{name}
+        </if>
+        <if test="companyId!=null and companyId!=0">
+            and  COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and pb_id!=#{id}
+        </if>
+    </where>
   </select>
 </mapper>

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml

@@ -129,7 +129,18 @@
     SELECT * FROM PRODUCTTYPE
   </select>
     <select id="selectCountByName" resultType="int">
-        SELECT COUNT(*) FROM PRODUCTTYPE WHERE PT_NAME=#{name} AND COMPANYID=#{companyId}
+        SELECT COUNT(*) FROM PRODUCTTYPE
+         <where>
+             <if test="name!=null">
+                 and PT_NAME=#{name}
+             </if>
+             <if test="companyId!=null and companyId!=0">
+                 and COMPANYID=#{companyId}
+             </if>
+             <if test="id != null and id != 0">
+                 and pt_id != #{id}
+             </if>
+         </where>
     </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PT_NAME display,PT_NAME value FROM PRODUCTTYPE WHERE COMPANYID=#{companyId}

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml

@@ -123,7 +123,18 @@
     SELECT * FROM PRODUCTUNIT
   </select>
     <select id="selectCountByName" resultType="int">
-        SELECT COUNT(*) FROM productunit WHERE PU_NAME=#{name} AND COMPANYID=#{companyId}
+        SELECT COUNT(*) FROM productunit
+        <where>
+            <if test="name!=null">
+                and PU_NAME=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and COMPANYID=#{companyId}
+            </if>
+            <if test="id!=0 and id!=null">
+                and pu_id != #{id}
+            </if>
+        </where>
     </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PU_NAME display,PU_NAME value FROM PRODUCTUNIT WHERE COMPANYID=#{companyId}

+ 6 - 6
applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml

@@ -51,7 +51,7 @@
       vc_text3, vc_text4, vc_text5, vc_default
       )
     values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
-      #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=INTEGER}, #{vc_qq,jdbcType=VARCHAR}, 
+      #{vc_name,jdbcType=VARCHAR}, #{vc_tel}, #{vc_qq,jdbcType=VARCHAR},
       #{vc_email,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, 
       #{vc_text3,jdbcType=VARCHAR}, #{vc_text4,jdbcType=VARCHAR}, #{vc_text5,jdbcType=VARCHAR},
@@ -118,7 +118,7 @@
         #{vc_name,jdbcType=VARCHAR},
       </if>
       <if test="vc_tel != null" >
-        #{vc_tel,jdbcType=INTEGER},
+        #{vc_tel},
       </if>
       <if test="vc_qq != null" >
         #{vc_qq,jdbcType=VARCHAR},
@@ -168,7 +168,7 @@
         vc_name = #{vc_name,jdbcType=VARCHAR},
       </if>
       <if test="vc_tel != null" >
-        vc_tel = #{vc_tel,jdbcType=INTEGER},
+        vc_tel = #{vc_tel},
       </if>
       <if test="vc_qq != null" >
         vc_qq = #{vc_qq,jdbcType=VARCHAR},
@@ -211,7 +211,7 @@
     set vc_veid = #{vc_veid},
       vc_detno = #{vc_detno,jdbcType=INTEGER},
       vc_name = #{vc_name,jdbcType=VARCHAR},
-      vc_tel = #{vc_tel,jdbcType=INTEGER},
+      vc_tel = #{vc_tel},
       vc_qq = #{vc_qq,jdbcType=VARCHAR},
       vc_email = #{vc_email,jdbcType=VARCHAR},
       companyId = #{companyId,jdbcType=INTEGER},
@@ -236,7 +236,7 @@
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
       #{item.vc_veid}, #{item.vc_detno,jdbcType=INTEGER},
-      #{item.vc_name,jdbcType=VARCHAR}, #{item.vc_tel,jdbcType=INTEGER}, #{item.vc_qq,jdbcType=VARCHAR},
+      #{item.vc_name,jdbcType=VARCHAR}, #{item.vc_tel}, #{item.vc_qq,jdbcType=VARCHAR},
       #{item.vc_email,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.vc_text1,jdbcType=VARCHAR}, #{item.vc_text2,jdbcType=VARCHAR},
       #{item.vc_text3,jdbcType=VARCHAR}, #{item.vc_text4,jdbcType=VARCHAR}, #{item.vc_text5,jdbcType=VARCHAR},
@@ -255,7 +255,7 @@
           vc_name = #{item.vc_name,jdbcType=VARCHAR},
         </if>
         <if test="item.vc_tel != null" >
-          vc_tel = #{item.vc_tel,jdbcType=INTEGER},
+          vc_tel = #{item.vc_tel},
         </if>
         <if test="item.vc_qq != null" >
           vc_qq = #{item.vc_qq,jdbcType=VARCHAR},

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml

@@ -132,6 +132,17 @@
     SELECT VK_NAME display, VK_NAME value FROM VENDORKIND WHERE COMPANYID=#{companyId}
   </select>
   <select id="selectCountByName" resultType="int">
-    SELECT COUNT(*) FROM VENDORKIND WHERE VK_NAME=#{name} AND COMPANYID=#{companyId}
+    SELECT COUNT(*) FROM VENDORKIND
+    <where>
+        <if test="name!=null">
+            and VK_NAME=#{name}
+        </if>
+        <if test="companyId!=0 and companyId!=null">
+            and COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and vk_id != #{id}
+        </if>
+    </where>
   </select>
 </mapper>

+ 12 - 1
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -330,7 +330,18 @@
     </select>
 
     <select id="selectCountByName" resultType="int">
-        SELECT COUNT(*) FROM warehouse WHERE wh_description=#{name} AND COMPANYID=#{companyId}
+        SELECT COUNT(*) FROM warehouse
+        <where>
+            <if test="name!=null">
+                and wh_description=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and COMPANYID=#{companyId}
+            </if>
+            <if test="id!=0 and id!=null">
+                and wh_id!=#{id}
+            </if>
+        </where>
     </select>
 
 </mapper>

+ 1 - 1
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/CustomerServiceTest.java

@@ -44,7 +44,7 @@ public class CustomerServiceTest {
         CustomercontactDTO item = new CustomercontactDTO();
         item.setCc_name("联系人1");
         item.setCc_detno(1);
-        item.setCc_tel(112);
+        item.setCc_tel(112L);
         item.setCc_qq("396996717");
         item.setCc_email("@qq.com");
 

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

@@ -129,7 +129,7 @@ public class ProdInOutController {
      * @param id
      * @return
      */
-    @PostMapping("/deleteItem/{id}")
+    @PostMapping("/deleteDetail/{id}")
     public Result deleteItem(@PathVariable("id") Long id) {
         prodInOutService.deleteItem(id);
         return Result.success();

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

@@ -401,9 +401,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //插入销售退货单主表
         ProdInOut targetPi = new ProdInOut();
         //生成单号
-        String piInoutno =
-                //BillCodeSeq.SALEIN.getCaller() + Math.abs(Math.random()*100);
-                maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
+        String piInoutno = maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
@@ -564,7 +562,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }else {//销售退货单
             caller = BillCodeSeq.SALEIN.getCaller();
         }
-        return maxnumberService.pushMaxnubmer(count, code, caller).getData();
+        return  maxnumberService.pushMaxnubmer(count, code, caller).getData();
         //return  caller+Math.abs(Math.random()*100);
     }
 
@@ -596,16 +594,19 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             prodIODetailMapper.updatePDSaleOut(id);
             //更新主表
             prodInOutMapper.updatePiTotal(id);
-
             //更新销售已转数
-            prodIODetailMapper.updateSaleYqty(prodInOut.getPi_said());
-        }else{//销售退货单
+            if(prodInOut.getPi_said()!=null) {
+                prodIODetailMapper.updateSaleYqty(prodInOut.getPi_said());
+            }
+        }else{//销售退货单z
             //更新明细
             prodIODetailMapper.updatePDSaleIN(id);
             //更新主表
             prodInOutMapper.updatePiTotal(id);
             //出货单已转数
-            prodIODetailMapper.updateSaleOutYqty(prodInOut.getPi_said());
+            if(prodInOut.getPi_said()!=null){
+                prodIODetailMapper.updateSaleOutYqty(prodInOut.getPi_said());
+            }
         }
     }
 

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

@@ -442,7 +442,6 @@ public class SaleServiceImpl implements SaleService{
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
         long pi_id = prodInOut.getId();
-
         for (int i=0;i<details.size();i++){
             SaleDetail saleDetail =details.get(i);
             ProdIODetail prodIODetail = new ProdIODetail();
@@ -472,11 +471,13 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_sendstatus(Status.TURNOUT.getDisplay());
         sale.setSa_sendstatuscode(Status.TURNOUT.name());
         //更新存在字段
-         saleMapper.updateByPrimaryKeySelective(sale);
-         //日志记录
-         DocBaseDTO baseDTO = new DocBaseDTO(pi_id, pi_inoutno, BillCodeSeq.SALEOUT.getCaller());
-         //messageLogService.customizeLog(baseDTO, Operation.);
-         return baseDTO;
+        saleMapper.updateByPrimaryKeySelective(sale);
+        prodInOutMapper.updatePiTotal(pi_id);
+        prodIODetailMapper.updatePDSaleOut(pi_id);
+        //日志记录
+        DocBaseDTO baseDTO = new DocBaseDTO(pi_id, pi_inoutno, BillCodeSeq.SALEOUT.getName());
+        //messageLogService.customizeLog(baseDTO, Operation.);
+        return baseDTO;
     }
 
     @Override

+ 4 - 8
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -739,14 +739,10 @@
 
   <update id="updateSaleOutYqty" parameterType="long">
 update prodiodetail a
-  set a.pd_yqty =IFNULL(
-    (
-      select  b.pd_inqty  from
-        (select pd_ioid,sum(pd_inqty) pd_inqty from  prodiodetail  where pd_piclass='销售退货单'
-          and pd_piid=#{id}  GROUP BY pd_ioid ) b
-          where IFNULL(b.pd_ioid ,0)= a.pd_id
-     ),0)
-where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pd_piclass='出货单')
+  set a.pd_yqty =ifnull((select  b.pd_inqty  from  (
+	select pd_ioid,sum(pd_inqty) pd_inqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售退货单'
+  and pi_said=#{id}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+  where a.pd_piid = (select pi_id from prodinout where pi_said=#{id} and pi_class='出货单');
   </update>
   <update id="updateSaleYqty" parameterType="long">
 

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

@@ -216,8 +216,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                             var field = me.ownerCt.down('[name='+item.to+']');
                             if(field){
                                 if(field.xtype=='dbfindtrigger'){
-                                    field.setRawValue(null);
-                                    field.value = null;
+                                    field.setValue(null);
                                     field.lastTriggerValue=null;
                                 }else{
                                     field.setValue(null);

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

@@ -54,6 +54,39 @@ Ext.define('saas.view.core.form.FormPanel', {
         me.initViewModel();
         me.FormUtil.setItems(me);
 
+        me.defaultBtns = me.defaultBtns || [{
+            cls: 'x-formpanel-btn-orange',
+            xtype: 'button',
+            text: '新增',
+            bind: {
+                hidden: '{!id}'
+            },
+            handler: 'add'
+        }, {
+            xtype: 'button',
+            text: '保存',
+            handler: 'onSave',
+            bind: {
+                // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
+                disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
+            }
+        }, {
+            xtype: 'button',
+            text: '删除',
+            bind: {
+                hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
+            },
+            handler: 'delete'
+        }, {
+            xtype: 'button',
+            bind: {
+                text: '{auditBtnText}',
+                disabled: '{!base.valid}',
+                hidden:'{!showAuditBtn}'
+            },
+            handler: "auditBtnClick",
+        }];
+
         Ext.apply(me, {
             dockedItems: [{
                 xtype: 'toolbar',
@@ -118,39 +151,6 @@ Ext.define('saas.view.core.form.FormPanel', {
             handler: 'codeEditorClick'
         }, '->'];
         
-        var defaultBtns = [{
-            cls: 'x-formpanel-btn-orange',
-            xtype: 'button',
-            text: '新增',
-            bind: {
-                hidden: '{!id}'
-            },
-            handler: 'add'
-        }, {
-            xtype: 'button',
-            text: '保存',
-            handler: 'onSave',
-            bind: {
-                // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
-                disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
-            }
-        }, {
-            xtype: 'button',
-            text: '删除',
-            bind: {
-                hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
-            },
-            handler: 'delete'
-        }, {
-            xtype: 'button',
-            bind: {
-                text: '{auditBtnText}',
-                disabled: '{!base.valid}',
-                hidden:'{!showAuditBtn}'
-            },
-            handler: "auditBtnClick",
-        }];
-
         if(me.codeInHeader) {
             items = items.concat(codeHeaderItems);
         }
@@ -160,7 +160,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         items = items.concat(me.toolBtns.map(function (btn) {
             btn.cls = btn.cls ? btn.cls + ' x-formpanel-btn-blue' : 'x-formpanel-btn-blue';
             return btn;
-        }).concat(defaultBtns))
+        }).concat(me.defaultBtns))
 
         return items;
     },
@@ -297,6 +297,10 @@ Ext.define('saas.view.core.form.FormPanel', {
     initFormData: function(data) {
         var me = this;
         me.setFormData(data);
+        var fields = me.getForm().getFields().items;
+        Ext.Array.each(fields, function(f) {
+            f.resetOriginalValue ? f.resetOriginalValue() : '';
+        });
     },
 
     /**
@@ -365,5 +369,26 @@ Ext.define('saas.view.core.form.FormPanel', {
                 typeof item.setDisabled == 'function' && item.setDisabled(!able);
             }
         });
-    }
+    },
+
+    //overriders
+    isDirty: function () {
+        var me = this,
+        detailGrids = me.query('detailGridField'),
+        dirty = false;
+
+        for(var i = 0; i < detailGrids.length; i++) {
+            var grid = detailGrids[i];
+            if(grid.isDirty()) {
+                dirty = true;
+                break;
+            }
+        }
+
+        if(!dirty) {
+            dirty = me.callParent();
+        }
+
+        return dirty;
+    },
 });

+ 0 - 8
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -57,10 +57,6 @@ Ext.define('saas.view.core.form.FormPanelController', {
             return false;
         }
 
-        if(form.getForm().wasDirty==false){
-            showToast('未修改数据,请修改后保存');
-            return false;
-        }
         //form里面数据
         var formData = form.getFormData();
         
@@ -127,10 +123,6 @@ Ext.define('saas.view.core.form.FormPanelController', {
             return false;
         }
         
-        if(form.getForm().wasDirty==false){
-            showToast('未修改数据,请修改后保存');
-            return false;
-        }
         //form里面数据
         var formData = form.getFormData();
         var params = {

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

@@ -362,6 +362,21 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         return valid;
     },
 
+    isDirty: function() {
+        var me = this,
+        store = me.getStore(),
+        dataItems = store.data.items;
+
+        for(var i = 0; i < dataItems.length; i++) {
+            var item = dataItems[i];
+            if(item.dirty) {
+                return true;
+            }
+        }
+
+        return false;
+    },
+
     /**
      * 获得所有数据
      */

+ 41 - 3
frontend/saas-web/app/view/core/tab/Controller.js

@@ -16,13 +16,51 @@ Ext.define('saas.view.core.tab.Controller', {
         tab.tabView = tab.add(view);
     },
 
-    onTabChange: function() {
+    onTabChange: function(component) {
         var me = this,
-        tab = me.getView(),
-        tabView = tab.tabView;
+        tabPanel = me.getView(),
+        tabView = tabPanel.tabView;
 
         if(typeof tabView.refresh == 'function') {
             tabView.refresh();
         }
+
+        if(!component.resetCloseClick) {
+            component.tab.onCloseClick = function() {
+                var me = this;
+         
+                if (me.fireEvent('beforeclose', me) !== false) {
+                    if (me.tabBar) {
+                        if(typeof tabView.isDirty == 'function' && tabView.isDirty()) {
+                            showConfirm('提示', '表单数据有修改,确定要退出吗?')
+                            .then(function(yes) {
+                                if(yes == 'yes') {
+                                    if (me.tabBar.closeTab(me) === false) {
+                                        return;
+                                    }
+                                }
+                            });
+                        }else {
+                            if (me.tabBar.closeTab(me) === false) {
+                                return;
+                            }
+                        }
+                    } else {
+                        if(typeof tabView.isDirty == 'function' && tabView.isDirty()) {
+                            showConfirm('提示', '表单数据有修改,确定要退出吗?')
+                            .then(function(yes) {
+                                if(yes == 'yes') {
+                                    me.fireClose();
+                                }
+                            });
+                        }else {
+                            me.fireClose();
+                        }
+                    }
+                }
+            }
+
+            component.resetCloseClick = true;
+        }
     }
 });

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

@@ -16,7 +16,7 @@ Ext.define('saas.view.document.bom.FormController', {
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
-    unAudit: function(){
+    audit: function(){
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();
@@ -30,7 +30,7 @@ Ext.define('saas.view.document.bom.FormController', {
             if(localJson.success){
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
+                //viewModel.set('base.editable', false);
                 showToast('启用成功');
             }
         })
@@ -39,7 +39,7 @@ Ext.define('saas.view.document.bom.FormController', {
             showToast('启用失败: ' + res.message);
         });
     },
-    audit: function() {
+    unAudit: function() {
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();
@@ -53,7 +53,7 @@ Ext.define('saas.view.document.bom.FormController', {
             if(localJson.success){
                 form.initId = localJson.data.id;
                 form.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
+                // viewModel.set('base.editable', false);
                 showToast('关闭成功');
             }
         })

+ 32 - 2
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -22,6 +22,37 @@ Ext.define('saas.view.document.bom.FormPanel', {
 
     codeInHeader: false,
 
+    defaultButtons:[{
+        cls: 'x-formpanel-btn-orange',
+        xtype: 'button',
+        text: '新增',
+        bind: {
+            hidden: '{!id}'
+        },
+        handler: 'add'
+    }, {
+        xtype: 'button',
+        text: '保存',
+        handler: 'onSave',
+        // bind: {
+        //     // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
+        //     disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
+        // }
+    }, {
+        xtype: 'button',
+        text: '删除',
+        // bind: {
+        //     hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
+        // },
+        handler: 'delete'
+    }, {
+        xtype: 'button',
+        bind: {
+            text: '{auditBtnText}'
+        },
+        handler: "auditBtnClick",
+    }],
+
     defaultItems: [{
         xtype: 'hidden',
         name: 'id',
@@ -112,6 +143,5 @@ Ext.define('saas.view.document.bom.FormPanel', {
         unAuditText: '已开启',
         auditBtnText: '关闭',
         unAuditBtnText: '启用',
-    },
-
+    }
 });

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

@@ -16,7 +16,7 @@ Ext.define('saas.view.document.customer.FormController', {
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
-    unAudit: function(){
+    audit: function(){
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();
@@ -39,7 +39,7 @@ Ext.define('saas.view.document.customer.FormController', {
             showToast('启用失败: ' + res.message);
         });
     },
-    audit: function() {
+    unAudit: function() {
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();

+ 31 - 1
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -336,6 +336,36 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 }
             }]
     }],
+    defaultButtons:[{
+        cls: 'x-formpanel-btn-orange',
+        xtype: 'button',
+        text: '新增',
+        bind: {
+            hidden: '{!id}'
+        },
+        handler: 'add'
+    }, {
+        xtype: 'button',
+        text: '保存',
+        handler: 'onSave',
+        // bind: {
+        //     // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
+        //     disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
+        // }
+    }, {
+        xtype: 'button',
+        text: '删除',
+        // bind: {
+        //     hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
+        // },
+        handler: 'delete'
+    }, {
+        xtype: 'button',
+        bind: {
+            text: '{auditBtnText}'
+        },
+        handler: "auditBtnClick",
+    }],
     auditTexts: {
         auditCode: 'CLOSE',
         auditText: '已关闭',
@@ -343,5 +373,5 @@ Ext.define('saas.view.document.customer.FormPanel', {
         unAuditText: '已开启',
         auditBtnText: '关闭',
         unAuditBtnText: '启用',
-    },
+    }
 });

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

@@ -141,7 +141,7 @@ Ext.define('saas.view.document.product.FormController', {
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
-    unAudit: function(){
+    audit: function(){
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();
@@ -164,7 +164,7 @@ Ext.define('saas.view.document.product.FormController', {
             showToast('启用失败: ' + res.message);
         });
     },
-    audit: function() {
+    unAudit: function() {
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();

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

@@ -179,11 +179,11 @@ Ext.define('saas.view.document.product.FormPanel', {
     }],
 
     auditTexts: {
-        auditCode: 'CLOSE',
-        auditText: '已关闭',
-        unAuditCode: 'OPEN',
-        unAuditText: '已开启',
-        auditBtnText: '关闭',
-        unAuditBtnText: '启用',
+        auditCode: 'OPEN',
+        auditText: '已开启',
+        unAuditCode: 'CLOSE',
+        unAuditText: '已关闭',
+        auditBtnText: '启用',
+        unAuditBtnText: '关闭',
     },
 });

+ 10 - 1
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -5,13 +5,22 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     viewModel: 'document-vendor-basepanel',
 
     searchField:[{
-        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
         emptyText : "请选择供应商类型", 
         columnWidth : 0.25,
         hiddenBtn:true
+    },{
+        xtype : "textfield", 
+        name : "ve_name", 
+        emptyText : "供应商名称", 
+        columnWidth : 0.25,
+    },{
+        xtype : "textfield", 
+        name : "ve_code", 
+        emptyText : "供应商编号", 
+        columnWidth : 0.25,
     }],
 
     //字段属性

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

@@ -15,7 +15,7 @@ Ext.define('saas.view.document.vendor.FormController', {
         status == 'OPEN' ? me.unAudit() : me.audit();
     },
 
-    unAudit: function(){
+    audit: function(){
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();
@@ -38,7 +38,7 @@ Ext.define('saas.view.document.vendor.FormController', {
             showToast('启用失败: ' + res.message);
         });
     },
-    audit: function() {
+    unAudit: function() {
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel();

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

@@ -238,11 +238,11 @@ Ext.define('saas.view.document.vendor.FormPanel', {
     ],
 
     auditTexts: {
-        auditCode: 'CLOSE',
-        auditText: '已关闭',
-        unAuditCode: 'OPEN',
-        unAuditText: '已开启',
-        auditBtnText: '关闭',
-        unAuditBtnText: '启用',
+        auditCode: 'OPEN',
+        auditText: '已开启',
+        unAuditCode: 'CLOSE',
+        unAuditText: '已关闭',
+        auditBtnText: '启用',
+        unAuditBtnText: '关闭',
     },
 });

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

@@ -30,7 +30,7 @@ Ext.define('saas.view.main.MainContainerWrap', {
                 margin: 10
             },
             plugins: [new Ext.ux.TabCloseMenu({
-                closeTabText: '关闭',
+                closeTabText: '关闭当前页',
                 closeAllTabsText: '关闭全部',
                 closeOthersTabsText: '关闭其他'
             })],

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

@@ -64,10 +64,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         xtype: 'numberfield',
         name: 'pb_pdamount',
         fieldLabel: '付款金额'
-    }, {
-        xtype: 'numberfield',
-        name: 'pb_pdamount',
-        fieldLabel: '付款金额'
     }, {
         xtype: "numberfield",
         name: "pb_pbdamount",
@@ -94,20 +90,28 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             dataIndex: 'id',
             hidden: true
         }, {
-            text: '期间',
-            dataIndex: 'pb_ym'
-        }, {
-            text: '结算账户ID',
-            dataIndex: 'pb_bankid'
-        }, {
-            text: '结算账户编号',
-            dataIndex: 'paybalancedet'
-        }, {
+            // text: '期间',
+            // dataIndex: 'pb_ym'
+            // editor: {
+            //     xtype: 'hidden',
+            //     // xtype: 'textfield,
+            //     // xtype: 'datefield''
+            // }
+        // }, {
+        //     text: '结算账户ID',
+        //     dataIndex: 'pb_bankid'
+        // }, {
+        //     text: '结算账户编号',
+        //     dataIndex: 'paybalancedet'
+        // }, {
             text: '结算账户',
             dataIndex: 'pb_bankname'
         }, {
             text: "付款金额",
             dataIndex: "pb_amount",
+            editor:{
+                xtype: 'numberfield'
+            }
         }, {
             text: "结算方式",
             dataIndex: "pb_paymethod"
@@ -116,7 +120,10 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             dataIndex: "pb_paycode"
         }, {
             text: "备注",
-            dataIndex: "pb_remark"
+            dataIndex: "pb_remark",
+            editor:{
+                xtype: 'textfield'
+            }
         }]
     }, {
         xtype: "detailGridField",
@@ -128,60 +135,76 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             dataIndex: 'id',
             hidden: true
         }, {
-            text: '期间',
-            dataIndex: 'pbd_ym'
-        }, {
-            text: '来源ID',
-            dataIndex: 'pbd_slid'
-        }, {
+        //     text: '期间',
+        //     dataIndex: 'pbd_ym'
+        // }, {
+        //     text: '来源ID',
+        //     dataIndex: 'pbd_slid'
+        // }, {
             text: '源单编号',
             dataIndex: 'pbd_slcode'
-        }, {
-            text: "单据类型",
-            dataIndex: "pbd_slkind",
+        // }, {
+        //     text: "单据类型",
+        //     dataIndex: "pbd_slkind",
         }, {
             text: "单据日期",
             dataIndex: "pbd_sldate",
+            xtype: 'datecolumn',
             defaultValue: new Date()
         }, {
             text: "单据金额",
-            dataIndex: "pbd_amount"
+            dataIndex: "pbd_amount",
+            editor:{
+                xtype: 'numberfield'
+            }
+        }, {
+            text: "已核销金额",
+            dataIndex: "pb_remark",
+            editor:{
+                xtype: 'numberfield'
+            }
+        }, {
+            text: "未核销金额",
+            dataIndex: "pb_remark",
+            editor:{
+                xtype: 'numberfield'
+            }
         }, {
-        //     text: "已核销金额",
-        //     dataIndex: "pb_remark"
-        // }, {
-        //     text: "未核销金额",
-        //     dataIndex: "pb_remark"
-        // }, {
             text: "本次核销金额",
-            dataIndex: "pbd_nowbalance"
+            dataIndex: "pbd_nowbalance",
+            editor:{
+                xtype: 'numberfield'
+            }
         }, {
             text: '备注',
-            dataIndex: 'pbd_remark'
+            dataIndex: 'pbd_remark',
+            editor:{
+                xtype: 'textfield'
+            }
         }]
     }, {
-        xtype: 'textareafield',
+        xtype: 'hidden',
         name: 'pb_remark',
         columnWidth: 1,
         fieldLabel: '备注'
     }, {
-        xtype: 'numberfield',
+        xtype: 'hidden',
         name: 'pb_recorderid',
         fieldLabel: '创建人ID'
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_recorder',
         fieldLabel: '创建人'
     }, {
-        xtype: "datefield",
+        xtype: "hidden",
         name: "pb_recorddate",
         fieldLabel: "创建时间"
     }, {
-        xtype: "datefield",
+        xtype: "hidden",
         name: "updatedate",
         fieldLabel: "更新时间"
     }, {
-        xtype: "textfield",
+        xtype: "hidden",
         readOnly: true,
         editable: false,
         name: "pb_status",
@@ -193,23 +216,23 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         name: "pb_statuscode",
         fieldLabel: "单据状态码"
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_text1',
         fieldLabel: '自定义字段1'
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_text2',
         fieldLabel: '自定义字段2'
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_text3',
         fieldLabel: '自定义字段3'
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_text4',
         fieldLabel: '自定义字段4'
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pb_text5',
         fieldLabel: '自定义字段5'
     }]

+ 59 - 19
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -5,56 +5,96 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
     init: function (form) {
         var me = this;
         this.control({
-            'dbfindtrigger[name=rb_custname]':{
+            // 供应商名称
+            'dbfindtrigger[name=pb_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        //数据接口
-                        dataUrl: '/api/document/customer/list',
-                        addXtype: 'document-customer-formpanel',
-                        addTitle: '客户资料',
+                        dataUrl:'/api/document/vendor/list',
+                        addXtype: 'document-vendor-formpanel',
+                        addTitle: '供应商资料',
+                        defaultCondition:"ve_statuscode='OPEN'",
                         //赋值 
                         dbfinds:[{
-                            from: 'id', to: 'rb_custid'
-                        }, {
-                            from:'cu_code', to:'rb_custcode'
+                            from:'ve_code',to:'pd_vendcode'
                         },{
-                            from:'cu_name', to:'rb_custname'
+                            from:'ve_name',to:'pb_vendname'
                         }],
                         //联想设置
                         dbtpls:[{
-                            field:'cu_code',width:100
+                            field:'ve_code',width:100
                         },{
-                            field:'cu_name',width:100
+                            field:'ve_name',width:100
                         }],
                         //联想查询条件
-                        dbCondition:"CONCAT(cu_code, cu_name) like '{0}%'",
+                        dbtplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 
-                            name : "cu_name", 
-                            conditionExpression:"cu_name like '{0}%'",//传入后台条件  替换占位符
-                            fieldLabel : "客户名称", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
                             columnWidth : 0.25
                         }],
                         //放大镜窗口列表
                         dbColumns:[{
-                            "text": "ID",
+                            "text": "供应商ID",
                             "flex": 0,
-                            "dataIndex": "id",
+                            "dataIndex": "ve_id",
                             "width": 0,
                             "xtype": "",
                             "items": null
                         },{
                             "text": "供应商编号",
                             "flex": 1,
-                            "dataIndex": "cu_code",
+                            "dataIndex": "ve_code",
                             "width": 100,
                             "xtype": "",
                             "items": null
                         }, {
                             "text": "供应商名称",
                             "flex": 1,
-                            "dataIndex": "cu_name",
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "税率",
+                            "flex": 0,
+                            "dataIndex": "ve_taxrate",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "承付天数",
+                            "flex": 0,
+                            "dataIndex": "ve_promisedays",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "纳税人识别号",
+                            "flex": 0,
+                            "dataIndex": "ve_nsrzh",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "开户银行",
+                            "flex": 0,
+                            "dataIndex": "ve_bankcode",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "银行账户",
+                            "flex": 0,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 200,
                             "xtype": "",
                             "items": null
                         }]

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

@@ -25,7 +25,8 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
             text: 'id',
             dataIndex: 'id',
             width: 100,
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            hidden:true
         }, {
             text: '单据编号',
             dataIndex: 'pb_code',
@@ -49,27 +50,33 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         }, {
             text: '收款人',
             dataIndex: 'pb_manname',
-            width: 120
+            width: 120,
+            hidden:true
         }, {
             text: '付款金额',
             dataIndex: 'pb_pdamount',
-            width: 120
+            width: 120,
+            hidden:true
         }, {
             text: '本次核销金额',
             dataIndex: 'pb_pbdamount',
             width: 120,
+            hidden:true
         }, {
             text: '本次预付款',
             dataIndex: 'pb_preamount',
             width: 120,
+            hidden:true
         }, {
             text: '整单折扣',
             dataIndex: 'pb_discounts',
             width: 120,
+            hidden:true
         }, {
             text: '已核销金额',
             dataIndex: 'pb_havebalance',
             width: 120,
+            hidden:true
         }],
         relativeColumn: []
     }

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

@@ -70,7 +70,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         addTitle:'销售退货单',
         addXtype:'sale-salein-formpanel',
         defaultCondition:' pi_class = \'销售退货单\'',
-        baseVastUrl: 'http://192.168.253.48:8820/prodinout/',
+        baseVastUrl: '/api/sale/prodinout/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',

+ 108 - 0
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -0,0 +1,108 @@
+Ext.define('saas.view.sys.config.FormPanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'sys-config-formpanel',
+
+    controller: 'sys-config-formpanel',
+    viewModel: 'sys-config-formpanel',
+    
+    //字段属性
+    _idField: 'id',
+    _readUrl:'/api/document/vendor/read/',
+    _saveUrl:'/api/document/vendor/save',
+
+    //基础属性
+    frame:true,
+    initId: 0,
+    layout: 'column',
+    autoScroll: true,
+    border: 1,
+    bodyPadding: 5,
+
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 0.25,
+        blankText: '该字段不能为空'
+    },
+    
+    tbar:[{
+        text:'保存',
+        handler:function(){
+
+        }
+    }],
+
+    items: [{
+        xtype: 'hidden',
+        name: 'id',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'en_name',
+        fieldLabel: '公司名称',
+        allowBlank: false,
+        columnWidth: 0.5
+    },{
+        xtype: 'textfield',
+        name: 'en_address',
+        fieldLabel: '公司地址',
+        allowBlank: true,
+        columnWidth: 0.5
+    },{
+        xtype: 'textfield',
+        name: 'en_tel',
+        fieldLabel: '电话',
+        allowBlank: true,
+        columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'en_fax',
+        fieldLabel: '传真',
+        allowBlank: true,
+        columnWidth: 0.5
+    },{
+        xtype : "datefield", 
+        name : "en_begindate", 
+        fieldLabel : "开账日期", 
+        allowBlank : true, 
+        editable:false,
+        columnWidth : 0.25
+    },{ 
+        displayField : "display", 
+        editable:false,
+        hideTrigger : false, 
+        maxLength : 100.0, 
+        minValue : null, 
+        queryMode : "local", 
+        valueField : "value", 
+        xtype : "combo",
+        store:{
+            fields: ['display', 'value'],
+            data : [
+                {"display":"加权平均法", "value":'1'},
+                {"display":"先进先出法", "value":'0'}
+            ]
+        },
+        name : "en_pricemethod", 
+        fieldLabel : "库存计算方式", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    },{  
+        xtype : "textfield", 
+        name : "en_signet", 
+        fieldLabel : "打印章上传", 
+        allowBlank : true, 
+        editable:false,
+        columnWidth : 0.25
+    },{  
+        xtype : "datefield", 
+        name : "updateTime", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        editable:false,
+        columnWidth : 0.25
+    }]
+});

+ 223 - 0
frontend/saas-web/app/view/sys/config/FormPanelController.js

@@ -0,0 +1,223 @@
+Ext.define('saas.view.sys.config.FormPanelController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.sys-config-formpanel',
+
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    FormUtil: Ext.create('saas.util.FormUtil'),
+
+    auditBtnClick: function() {
+        var me = this,
+        form = me.getView(),
+        statusCodeField = form._statusCodeField,
+        viewModel = me.getViewModel(),
+        status = viewModel.get(statusCodeField);
+
+        status == 'AUDITED' ? me.unAudit() : me.audit();
+    },
+
+    add: function(){
+        var form = this.getView();
+        var id = form.xtype + '-add';
+        openTab(form.xtype,'新增' + form._title, id);
+    },
+    
+    delete: function(){
+        var me = this;
+        var form = this.getView();
+        var viewModel = me.getViewModel();
+        var id = viewModel.get(form._idField);
+        var code = viewModel.get(form._codeField);
+        if(id&&id.value!=0){
+            me.BaseUtil.request({
+                url: form._deleteUrl+id,
+                method: 'POST',
+            })
+            .then(function(localJson) {
+                if(localJson.success){
+                    var mainTab = Ext.getCmp('main-tab-panel');
+                    mainTab.getActiveTab().close();
+                    //解析参数
+                    showToast('删除成功');
+                }
+            })
+            .catch(function(res) {
+                console.error(res);
+                showToast('删除失败: ' + res.message);
+            });
+        }
+    },
+
+    onSave: function() {
+        var me = this,
+        form = this.getView();
+
+        var valid = form.isValid();
+        if(!valid) {
+            showToast('表单校验有误,请检查');
+            return false;
+        }
+
+        if(form.getForm().wasDirty==false){
+            showToast('未修改数据,请修改后保存');
+            return false;
+        }
+        //form里面数据
+        var formData = form.getFormData();
+        
+        me.save(formData);
+    },
+
+    save:function(formData){
+        var me = this,
+        form = this.getView(),
+        detailCount = form.detailCount,
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData();
+
+        var params = {
+            main:formData.main
+        };
+
+        for(var i = 0; i < detailCount; i++) {
+            params['items' + ( i + 1)] = formData['detail' + i];
+        }
+
+        // 只有一个从表时从表字段改为items
+        if(detailCount == 1) {
+            params.items = params.items1;
+            delete params.items1;
+        }
+
+        me.BaseUtil.request({
+            url: form._saveUrl,
+            params: JSON.stringify(params),
+            method: 'POST',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                var id = localJson.data.id;
+                var code = localJson.data.code;
+                form.initId = id;
+                form.FormUtil.loadData(form);
+                showToast('保存成功');
+
+                var newId = form.xtype + '-' + id;
+                var newTitle = form._title + '(' + code + ')';
+
+                refreshTabTitle(newId, newTitle);
+            }
+        })
+        .catch(function(res) {
+            console.error(res);
+            showToast('保存失败: ' + res.message);
+        });
+    },
+
+    audit: function(){
+        var me = this,
+        form = this.getView(),
+        detailCount = form.detailCount,
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData();
+
+        var valid = form.isValid();
+
+        if(!valid) {
+            showToast('表单校验有误,请检查');
+            return false;
+        }
+        
+        if(form.getForm().wasDirty==false){
+            showToast('未修改数据,请修改后保存');
+            return false;
+        }
+        //form里面数据
+        var formData = form.getFormData();
+        var params = {
+            main: formData.main
+        };
+
+        for(var i = 0; i < detailCount; i++) {
+            params['items' + ( i + 1)] = formData['detail' + i];
+        }
+
+        // 只有一个从表时从表字段改为items
+        if(detailCount == 1) {
+            params.items = params.items1;
+            delete params.items1;
+        }
+
+        me.BaseUtil.request({
+            url: form._auditUrl,
+            params: JSON.stringify(params),
+            method: 'POST',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                // 未保存直接审核会返回id
+                if(localJson.data) {
+                    var id = localJson.data.id;
+                    var code = localJson.data.code;
+                    
+                    form.initId = id;
+
+                    var newId = form.xtype + '-' + id;
+                    var newTitle = form._title + '(' + code + ')';
+
+                    refreshTabTitle(newId, newTitle);
+                }
+                form.FormUtil.loadData(form);
+                form.setEditable(false);
+                showToast('审核成功');
+            }
+        })
+        .catch(function(res) {
+            console.error(res);
+            showToast('审核失败: ' + res.message);
+        });
+    },
+    unAudit: function() {
+        var me = this;
+        var form = this.getView();
+        var viewModel = me.getViewModel();
+        var id = viewModel.get(form._idField);
+        var code = viewModel.get(form._codeField);
+        if(id&&id.value!=0){
+            me.BaseUtil.request({
+                url: form._unAuditUrl+id,
+                method: 'POST',
+            })
+            .then(function(localJson) {
+                if(localJson.success){
+                    //解析参数
+                    showToast('反审核成功');
+                    form.FormUtil.loadData(form);
+                }
+            })
+            .catch(function(res) {
+                console.error(res);
+                showToast('反审核失败: ' + res.message);
+            });
+        }
+    },
+    codeEditorBlur: function(e) {
+        var me = this,
+        viewModel = me.getViewModel(),
+        targetEl = event.target,
+        faEl = targetEl.getElementsByClassName('fa')[0];
+
+        if(faEl && faEl.classList.contains('fa-check-circle')) {
+            // 处理重复触发事件
+            // viewModel.set('base.codeEditable', false);
+        }else {
+            viewModel.set('base.codeEditable', false);
+        }
+    },
+    codeEditorClick: function() {
+        var me = this,
+        viewModel = me.getViewModel(),
+        codeEditable = viewModel.get('base.codeEditable');
+
+        viewModel.set('base.codeEditable', !codeEditable);
+    }
+});

+ 5 - 0
frontend/saas-web/app/view/sys/config/FormPanelModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.sys.config.FormPanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.sys-config-formpanel',
+
+});

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

@@ -60,6 +60,14 @@ function getCurrentTab() {
     return currentTab;
 }
 
+function showConfirm(title, message) {
+    return new Ext.Promise(function (resolve, reject) {
+        Ext.MessageBox.confirm(title, message, function(buttonId) {
+            return resolve(buttonId);
+        });
+    })
+}
+
 function warnMsg(msg, fn){
 	Ext.MessageBox.show({
      	title: '提示',

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

@@ -266,6 +266,11 @@
             "text": "结账/反结账",
             "viewType": "sys-finish-datalist",
             "leaf": true
+        },{
+            "id":"sys-config-formpanel",
+            "text": "参数设置",
+            "viewType": "sys-config-formpanel",
+            "leaf": true
         }]
     }]
 }]