Browse Source

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

hy 7 years ago
parent
commit
6336f23441
100 changed files with 5260 additions and 2746 deletions
  1. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  2. 1 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  3. 9 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Product.java
  4. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  5. 12 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  6. 1 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java
  7. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java
  8. 1 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  9. 1 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  10. 9 3
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  11. 6 0
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  12. 13 0
      applications/purchase/purchase-server/src/main/resources/config/application-dev.yml
  13. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  14. 0 2
      applications/transfers/transfers-server/pom.xml
  15. 0 0
      applications/transfers/transfers-server/src/main/docker/Dockerfile
  16. 40 0
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/po/MessageInfo.java
  17. 12 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java
  18. 4 4
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  19. 6 0
      base-servers/datacenter/datacenter-client/src/main/java/com/usoftchina/saas/dc/client/interceptor/DataSourceInterceptor.java
  20. 4 0
      base-servers/datacenter/datacenter-server/pom.xml
  21. 25 0
      base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/controller/DataSourceInfoController.java
  22. 2 0
      base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/service/DataSourceInfoService.java
  23. 6 0
      base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/service/impl/DataSourceInfoServiceImpl.java
  24. 13 0
      base-servers/datacenter/datacenter-server/src/main/resources/config/application-dev.yml
  25. 2 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  26. 1 1
      base-servers/gateway-server/src/main/resources/application.yml
  27. 4 0
      framework/core/src/main/java/com/usoftchina/saas/jdbc/DynamicDataSourceRegister.java
  28. 0 1
      frontend/saas-portal-web/src/components/conenter/invitation.vue
  29. 4 1
      frontend/saas-portal-web/static/css/gongsi.css
  30. 0 0
      frontend/saas-portal-web/static/js/stomp.min.js
  31. 12 0
      frontend/saas-web/app/Application.scss
  32. 9 5
      frontend/saas-web/app/model/Session.js
  33. 6 1
      frontend/saas-web/app/model/document/ProductDetail.js
  34. 6 1
      frontend/saas-web/app/model/document/customeraddress.js
  35. 6 1
      frontend/saas-web/app/model/document/customercontact.js
  36. 6 1
      frontend/saas-web/app/model/document/stocking.js
  37. 6 1
      frontend/saas-web/app/model/document/vendorcontact.js
  38. 6 1
      frontend/saas-web/app/model/money/RecBalance1.js
  39. 6 1
      frontend/saas-web/app/model/money/RecBalance2.js
  40. 5 0
      frontend/saas-web/app/model/sale/SaleInDetail.js
  41. 5 0
      frontend/saas-web/app/model/sale/SaleOutDetail.js
  42. 5 0
      frontend/saas-web/app/model/sale/Saledetail.js
  43. 8 1
      frontend/saas-web/app/model/stock/Makematerial.js
  44. 0 39
      frontend/saas-web/app/model/stock/ProdIODetail.js
  45. 40 19
      frontend/saas-web/app/util/BaseUtil.js
  46. 239 114
      frontend/saas-web/app/util/FormUtil.js
  47. 139 0
      frontend/saas-web/app/util/ViewUtil.js
  48. 24 23
      frontend/saas-web/app/view/auth/LoginController.js
  49. 103 0
      frontend/saas-web/app/view/auth/ReLogin.js
  50. 15 0
      frontend/saas-web/app/view/auth/ReLogin.scss
  51. 103 0
      frontend/saas-web/app/view/auth/ReLoginController.js
  52. 14 2
      frontend/saas-web/app/view/core/base/BasePanel.js
  53. 37 0
      frontend/saas-web/app/view/core/base/BasePanelController.js
  54. 121 97
      frontend/saas-web/app/view/core/base/GridPanel.js
  55. 78 65
      frontend/saas-web/app/view/core/form/FormPanel.js
  56. 80 20
      frontend/saas-web/app/view/core/form/FormPanelController.js
  57. 488 0
      frontend/saas-web/app/view/core/form/SettingWin.js
  58. 29 0
      frontend/saas-web/app/view/core/form/SettingWin.scss
  59. 139 0
      frontend/saas-web/app/view/core/form/SettingWinController.js
  60. 18 4
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  61. 15 0
      frontend/saas-web/app/view/core/form/field/SeparateField.js
  62. 74 37
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  63. 4 7
      frontend/saas-web/app/view/core/query/QueryPanel.js
  64. 38 0
      frontend/saas-web/app/view/core/query/QueryPanelController.js
  65. 157 114
      frontend/saas-web/app/view/core/report/ReportPanel.js
  66. 54 18
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  67. 2 1
      frontend/saas-web/app/view/core/tab/Controller.js
  68. 2 3
      frontend/saas-web/app/view/document/address/DataList.js
  69. 3 3
      frontend/saas-web/app/view/document/address/DatalistController.js
  70. 110 101
      frontend/saas-web/app/view/document/bom/BasePanel.js
  71. 3 3
      frontend/saas-web/app/view/document/bom/FormController.js
  72. 237 162
      frontend/saas-web/app/view/document/bom/FormPanel.js
  73. 122 112
      frontend/saas-web/app/view/document/customer/BasePanel.js
  74. 4 5
      frontend/saas-web/app/view/document/customer/FormController.js
  75. 358 254
      frontend/saas-web/app/view/document/customer/FormPanel.js
  76. 2 3
      frontend/saas-web/app/view/document/employee/DataList.js
  77. 2 3
      frontend/saas-web/app/view/document/employee/Window.js
  78. 4 5
      frontend/saas-web/app/view/document/kind/ChildForm.js
  79. 2 3
      frontend/saas-web/app/view/document/kind/KindController.js
  80. 140 133
      frontend/saas-web/app/view/document/product/BasePanel.js
  81. 4 6
      frontend/saas-web/app/view/document/product/FormController.js
  82. 287 217
      frontend/saas-web/app/view/document/product/FormPanel.js
  83. 118 112
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  84. 4 6
      frontend/saas-web/app/view/document/vendor/FormController.js
  85. 272 203
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  86. 2 3
      frontend/saas-web/app/view/document/warehouse/DataList.js
  87. 2 3
      frontend/saas-web/app/view/document/warehouse/Window.js
  88. 2 2
      frontend/saas-web/app/view/home/Home.js
  89. 6 6
      frontend/saas-web/app/view/home/HomeModel.js
  90. 76 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  91. 125 119
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  92. 243 171
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  93. 184 179
      frontend/saas-web/app/view/money/othreceipts/QueryPanel.js
  94. 76 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  95. 183 178
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  96. 119 18
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  97. 2 3
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  98. 148 139
      frontend/saas-web/app/view/money/payBalance/QueryPanel.js
  99. 12 0
      frontend/saas-web/app/view/money/payBalance/QueryPanelController.js
  100. 123 1
      frontend/saas-web/app/view/money/recBalance/FormPanel.js

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

@@ -41,7 +41,7 @@
 
 
     <select id="getStorageData" parameterType="long" resultType="string">
-      select concat('[',d1,',',d2,',',d3,',',d4,',',d5,',',d6,']') from (
+      select concat('[',d6,',',d5,',',d4,',',d3,',',d2,',',d1,']') from (
 
 (select concat('{"x":',DATE_FORMAT(now(),'%c'),',"y":',ifnull(ROUND(sum((ifnull(si_amount/10000,0))),2),'0'),'}') d1 from   statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='STOCK' ORDER BY si_amount desc) data_1,
 
@@ -76,7 +76,7 @@
     </select>
 
     <select id="getSaleFutureData" parameterType="long" resultType="string">
-       	select concat('[',d1,',',d2,',',d3,',',d4,',',d5,',',d6,']') from (
+       	select concat('[',d6,',',d5,',',d4,',',d3,',',d2,',',d1,']') from (
         (select concat('{"x":',DATE_FORMAT(now(),'%c'),',"sale":',ifnull(ROUND(sum((ifnull(si_amount/10000,0))),2),'0'),',"saleback":',ifnull(ROUND(sum((ifnull(si_amount_rec/10000,0))),2),'0'),'}') d1 from   statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALERETURN' ORDER BY si_amount desc) data_1,
 
         (select concat('{"x":',DATE_FORMAT(date_sub(now(),interval 1 MONTH),'%c'),',"sale":',ifnull(ROUND(sum((ifnull(si_amount/10000,0))),2),'0'),',"saleback":',ifnull(ROUND(sum((ifnull(si_amount_rec/10000,0))),2),'0'),'}') d2 from  statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(date_sub(now(),interval 1 MONTH),'%Y%m') and si_type='SALERETURN' ORDER BY si_amount desc)data_2,

+ 1 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java

@@ -40,4 +40,5 @@ public class ProductDTO implements Serializable {
     private Double po_onhand;
 
     private Double po_avprice;
+    private String pr_remark;
 }

+ 9 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Product.java

@@ -32,6 +32,15 @@ public class Product extends CommonBaseEntity implements Serializable {
     private String pr_text2;
     private String pr_text3;
     private String pr_text4;
+    private String pr_remark;
+
+    public String getPr_remark() {
+        return pr_remark;
+    }
+
+    public void setPr_remark(String pr_remark) {
+        this.pr_remark = pr_remark;
+    }
 
     public String getPr_code() {
         return pr_code;

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

@@ -450,6 +450,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
     @Override
     public boolean deleteByPrimaryKey(Long id) {
+        Product productTemp = getMapper().selectByPrimaryKey(id);
+        if (ObjectUtils.isEmpty(productTemp)){
+            throw new BizException(BizExceptionCode.ORDER_NOT_EXITTS);
+        }
         //校验物料是否已经在使用状态(采购单、销售单、BOM、出入库单)
         validProductOperation(id, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
         //校验是否存在关联单据

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

@@ -31,6 +31,7 @@
         <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR"/>
         <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR"/>
         <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR"/>
+        <result column="pr_remark" property="pr_remark" jdbcType="VARCHAR"/>
     </resultMap>
     <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
         <id column="pr_id" property="id" jdbcType="INTEGER"/>
@@ -53,6 +54,7 @@
         <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER"/>
         <result column="pr_status" property="pr_status" jdbcType="VARCHAR"/>
         <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR"/>
+        <result column="pr_remark" property="pr_remark" jdbcType="VARCHAR"/>
     </resultMap>
 
 
@@ -97,7 +99,7 @@
         pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
         pr_vendid, pr_vendcode, pr_vendname, pr_status,
         pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
-        pr_text4, pr_text5
+        pr_text4, pr_text5,pr_remark
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
         select
@@ -233,6 +235,9 @@
             <if test="creatorName != null" >
                 creatorName,
             </if>
+            <if test="pr_remark != null" >
+                pr_remark,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="pr_code != null">
@@ -328,6 +333,9 @@
             <if test="creatorName != null" >
                 #{creatorName,jdbcType=VARCHAR},
             </if>
+            <if test="pr_remark != null" >
+                #{pr_remark,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Product">
@@ -417,6 +425,9 @@
             <if test="pr_text5 != null">
                 pr_text5 = #{pr_text5,jdbcType=VARCHAR},
             </if>
+            <if test="pr_remark != null">
+                pr_remark = #{pr_remark,jdbcType=VARCHAR},
+            </if>
         </set>
         where pr_id = #{id}
     </update>

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

@@ -50,4 +50,5 @@ public interface PaybalanceMapper extends CommonBaseMapper<Paybalance> {
     String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
 
     String validateAudit(List<DocBaseDTO> baseDTOs);
+    void updateByAmount(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -57,4 +57,6 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
     String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
 
     String validateAudit(List<DocBaseDTO> baseDTOs);
+
+    void updateByAmount(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -120,6 +120,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
                 paybalancedetailMapper.insertSelective(paybalancedetail1);
             }
         }
+        paybalanceMapper.updateByAmount(pbId, BaseContextHolder.getCompanyId());
         return baseDTO;
     }
 

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

@@ -121,6 +121,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
                 recbalancedetailMapper.insertSelective(recbalancedetail1);
             }
         }
+        recbalanceMapper.updateByAmount(rbId, BaseContextHolder.getCompanyId());
         return baseDTO;
     }
 

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

@@ -137,6 +137,12 @@
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
+
+  <update id="updateByAmount">
+    update paybalance set pb_amount = (select sum(ifnull(pd_amount,0.0)) from paybalancedet where pd_pbid = pb_id )
+ where  pb_id = #{id,jdbcType=INTEGER} and companyId =#{companyId}
+  </update>
+
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Paybalance">
     insert into paybalance (pb_code, pb_kind,
       pb_date, pb_vendid, pb_vendcode, 
@@ -211,9 +217,6 @@
       <if test="updaterId != null">
         updaterId,
       </if>
-      <if  test="pb_amount != null">
-        pb_amount,
-      </if>
       <if test="pb_text1 != null">
         pb_text1,
       </if>
@@ -235,6 +238,9 @@
       <if test="createTime != null" >
         createTime,
       </if>
+      <if test="pb_amount != null" >
+        pb_amount,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="pb_code != null">

+ 6 - 0
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -130,6 +130,12 @@
       order by ${orderByClause}
     </if>
   </select>
+
+  <update id="updateByAmount">
+    update recbalance set rb_amount = (select sum(ifnull(rd_amount,0.0)) from recbalancedet where rd_rbid = rb_id )
+ where  rb_id = #{id,jdbcType=INTEGER} and companyId =#{companyId}
+  </update>
+
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />,

+ 13 - 0
applications/purchase/purchase-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,13 @@
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    prefer-ip-address: true
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/

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

@@ -146,6 +146,8 @@ public class SaleServiceImpl implements SaleService{
                 saledetailMapper.batchInsert(insertDetails);
             }
             baseDTO = getBaseDTOById(sa_id);
+            //明细需求日期为空时==主表交货日期
+            saleMapper.updateDelivery(sa_id);
             //更新销售金额
             updateTotal(sa_id);
             //更新从表总额

+ 0 - 2
applications/transfers/transfers-server/pom.xml

@@ -9,9 +9,7 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>com.usoftchina.saas</groupId>
     <artifactId>transfers-server</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

+ 0 - 0
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/docker/Dockerfile → applications/transfers/transfers-server/src/main/docker/Dockerfile


+ 40 - 0
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/po/MessageInfo.java

@@ -24,10 +24,43 @@ public class MessageInfo implements Serializable {
      * 业务类型
      */
     private String bizType;
+
     /**
      * 业务单据ID
      */
+
     private String bizId;
+    /**
+     * 公司id
+     * @return
+     */
+    private Long companyId;
+
+    /**
+     * 时间戳
+     */
+    private long timestamp;
+
+    public long getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public int getRetryCount() {
+        return retryCount;
+    }
+
+    public void setRetryCount(int retryCount) {
+        this.retryCount = retryCount;
+    }
+
+    /**
+     * 重试次数
+     */
+    private int retryCount;
 
     public String getMsgId() {
         return msgId;
@@ -79,4 +112,11 @@ public class MessageInfo implements Serializable {
     public MessageInfo() {
 
     }
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
 }

+ 12 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java

@@ -1,5 +1,8 @@
 package com.usoftchina.saas.account.controller;
 
+import com.usoftchina.saas.account.cache.AccountCache;
+import com.usoftchina.saas.account.cache.CompanyCache;
+import com.usoftchina.saas.account.cache.ResourceCache;
 import com.usoftchina.saas.account.dto.*;
 import com.usoftchina.saas.account.po.Account;
 import com.usoftchina.saas.account.po.RoleResource;
@@ -482,4 +485,13 @@ public class AccountController {
         accountService.shareJoin(shareAddDTO);
         return Result.success();
     }
+
+    //清空缓存
+    @RequestMapping("/cache/clearAll")
+    public Result clearAll() {
+        CompanyCache.current().clear();
+        AccountCache.current().clear();
+        ResourceCache.current().clear();
+        return Result.success();
+    }
 }

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

@@ -116,7 +116,7 @@ public class AuthController {
             TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
             //登陆成功记入redis
             String key = CacheKeyHelper.generatePublicKey(tokenDTO.getToken());
-            RedisUtil.set(key, tokenDTO, expire);
+            RedisUtil.set(key, info, expire);
             // 登录日志
             authorizeLogService.save(AuthorizeLog.from(request)
                     .setAccountId(accountDTO.getId())
@@ -158,7 +158,7 @@ public class AuthController {
         TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
         //登陆成功记入redis
         String key = CacheKeyHelper.generatePublicKey(tokenDTO.getToken());
-        RedisUtil.set(key, tokenDTO, expire);
+        RedisUtil.set(key, info, expire);
         // 登录日志
         authorizeLogService.saveVirtual(VirtualAuthorizeLog.from(request)
                 .setMobile(Long.parseLong(accountDTO.getMobile()))
@@ -215,7 +215,7 @@ public class AuthController {
             }
             //登陆成功记入redis
             String key = CacheKeyHelper.generatePublicKey(tokenDTO.getToken());
-            RedisUtil.set(key, authDTO, expire);
+            RedisUtil.set(key, jwtInfo, expire);
             return Result.success(authDTO);
         }
         return Result.error(ExceptionCode.COOKIE_ILLEGAL_ARGUMENT);
@@ -274,7 +274,7 @@ public class AuthController {
                 AuthDTO authDTO = new AuthDTO(tokenDTO, accountDTO);
                 //登陆成功记入redis
                 String key = CacheKeyHelper.generatePublicKey(tokenDTO.getToken());
-                RedisUtil.set(key, authDTO, expire);
+                RedisUtil.set(key, jwtInfo, expire);
                 socketMessageApi.sendToClient(new ClientMessage(clientId, "/sso/callback",
                         JsonUtils.toJsonString(authDTO)));
             }

+ 6 - 0
base-servers/datacenter/datacenter-client/src/main/java/com/usoftchina/saas/dc/client/interceptor/DataSourceInterceptor.java

@@ -8,6 +8,8 @@ import com.usoftchina.saas.dc.dto.DataSourceInfoDTO;
 import com.usoftchina.saas.jdbc.DynamicDataSourceContextHolder;
 import com.usoftchina.saas.jdbc.DynamicDataSourceRegister;
 import com.usoftchina.saas.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.lang.Nullable;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -24,6 +26,8 @@ public class DataSourceInterceptor extends HandlerInterceptorAdapter {
     @Autowired
     private DynamicDataSourceRegister dataSourceRegister;
 
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
         long companyId = BaseContextHolder.getCompanyId();
@@ -34,6 +38,8 @@ public class DataSourceInterceptor extends HandlerInterceptorAdapter {
             if (StringUtils.hasText(dcName)) {
                 String dbName = dataSourceRegister.getDefaultDatabaseName();
                 DataSourceInfoDTO dataSourceInfoDTO = DataSourceCache.of(dcName, dbName).getDataSourceInfo();
+                logger.info("DbName={} hostname={} DbRealName={}", dataSourceInfoDTO.getDbName(), dataSourceInfoDTO.getDbHost(),
+                        dataSourceInfoDTO.getDbRealName());
                 if (null != dataSourceInfoDTO) {
                     // 如果不存在数据源则自动创建
                     dataSourceRegister.createDataSource(dataSourceInfoDTO);

+ 4 - 0
base-servers/datacenter/datacenter-server/pom.xml

@@ -49,6 +49,10 @@
             <artifactId>test-starter</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-api</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 25 - 0
base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/controller/DataSourceInfoController.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.dc.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.dc.cache.DataSourceCache;
 import com.usoftchina.saas.dc.dto.DataSourceInfoDTO;
 import com.usoftchina.saas.dc.service.DataSourceInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,4 +26,28 @@ public class DataSourceInfoController {
                                                 @RequestParam("dbName") String dbName) {
         return Result.success(dataSourceInfoService.findDataSourceInfo(dcName, dbName));
     }
+
+    /**
+     * 数据库缓存清除
+     *
+     * @return
+     */
+    @GetMapping("/cache/clear")
+    public Result clearCache(@RequestParam("dcName") String dcName,
+                             @RequestParam("dbName") String dbName) {
+        dataSourceInfoService.clearCache(dcName, dbName);
+        return Result.success();
+    }
+
+    /**
+     * 数据库缓存清除
+     *
+     * @return
+     */
+    @GetMapping("/cache/clearAll")
+    public Result clearCacheAll(@RequestParam(value = "dcName", required = false) String dcName,
+                                @RequestParam(value = "dbName", required = false) String dbName) {
+        DataSourceCache.of(dcName, dbName).clear();
+        return Result.success();
+    }
 }

+ 2 - 0
base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/service/DataSourceInfoService.java

@@ -16,4 +16,6 @@ public interface DataSourceInfoService {
      * @return
      */
     DataSourceInfo findDataSourceInfo(String dcName, String dbName);
+
+    void clearCache(String dcName, String dbName);
 }

+ 6 - 0
base-servers/datacenter/datacenter-server/src/main/java/com/usoftchina/saas/dc/service/impl/DataSourceInfoServiceImpl.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.dc.service.impl;
 
+import com.usoftchina.saas.dc.cache.DataSourceCache;
 import com.usoftchina.saas.dc.mapper.DataSourceInfoMapper;
 import com.usoftchina.saas.dc.po.DataSourceInfo;
 import com.usoftchina.saas.dc.service.DataSourceInfoService;
@@ -20,4 +21,9 @@ public class DataSourceInfoServiceImpl implements DataSourceInfoService{
     public DataSourceInfo findDataSourceInfo(String dcName, String dbName) {
         return dataSourceInfoMapper.selectByDcNameAndDbName(dcName, dbName);
     }
+
+    @Override
+    public void clearCache(String dcName, String dbName) {
+        DataSourceCache.of(dcName, dbName).hdel();
+    }
 }

+ 13 - 0
base-servers/datacenter/datacenter-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,13 @@
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    prefer-ip-address: true
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/

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

@@ -85,6 +85,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
                             //将现在的request 变成 change对象
                             exchange = exchange.mutate().request(request).build();
                         }
+                        //删除已过期token信息
+                        RedisUtil.del(key);
                     }
                 }
                 BaseContextHolder.setAppId(jwt.getAppId());

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

@@ -187,7 +187,7 @@ auth:
     - /ws/**
     - /api/file/download
     - /api/commons/excel/import/templet
-    - /api/commons/share/valid/param
+    - /api/commons/share/valid/**
     - /api/commons/share/weixin/ticket
     - /api/commons/share/getSmsCode
     - /api/commons/share/submit

+ 4 - 0
framework/core/src/main/java/com/usoftchina/saas/jdbc/DynamicDataSourceRegister.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.jdbc;
 
 import com.zaxxer.hikari.HikariDataSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
 import org.springframework.boot.jdbc.DataSourceBuilder;
 
@@ -12,6 +14,7 @@ public class DynamicDataSourceRegister {
     private DataSourceProperties defaultProperties;
     private final String defaultDatabaseName;
     private DynamicDataSource dynamicDataSource;
+    private Logger logger = LoggerFactory.getLogger(getClass());
 
     public DynamicDataSourceRegister(DataSourceProperties defaultProperties, DynamicDataSource dynamicDataSource) {
         this.defaultProperties = defaultProperties;
@@ -21,6 +24,7 @@ public class DynamicDataSourceRegister {
 
     public void createDataSource(Connectable connectable) {
         if (!dynamicDataSource.containsDataSource(connectable.qualifier())) {
+            logger.info("connectable:" + connectable);
             HikariDataSource dataSource = DataSourceBuilder.create(defaultProperties.getClassLoader())
                     .type(HikariDataSource.class)
                     .driverClassName(defaultProperties.determineDriverClassName())

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

@@ -283,7 +283,6 @@ import { setTimeout } from 'timers';
                     } else {
                         this.$message.error({
                             message:res.data.message,
-                            center : true
                             });
                         this.$router.push({path:'/failure'})
                     }

+ 4 - 1
frontend/saas-portal-web/static/css/gongsi.css

@@ -26,10 +26,13 @@ input::-webkit-input-placeholder {
     padding: 0 !important;
     text-align: center !important;
     margin-top: 0px !important;
+    opacity: 0.8 !important;
 }
+/* ele提示弹窗 */
 .el-message {
-    min-width: 240px !important;
+    min-width: 160px !important;
     height: 32px !important;
+    padding-right: 18px !important;
 }
 /* 弹窗 -----------------------------------------------*/
 .tanchuang {

File diff suppressed because it is too large
+ 0 - 0
frontend/saas-portal-web/static/js/stomp.min.js


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

@@ -143,6 +143,18 @@ body.launching {
   }
 }
 
+.x-toolbar {
+  .x-btn-over.x-btn-plain-toolbar-small{
+    .x-btn-wrap{
+      .x-btn-button{
+        .x-btn-inner{
+          color: #606060;
+        }
+      }
+    }
+  }
+}
+
 .x-btn-pressed{
   .x-btn-wrap{
     .x-btn-button{

+ 9 - 5
frontend/saas-web/app/model/Session.js

@@ -10,14 +10,18 @@ Ext.define('saas.model.Session', {
     ],
 
     statics: {
-        login: function(username, password) {
+        login: function(username, password, companyId) {
+            let params = {
+                username: username,
+                password: password
+            };
+            if(companyId) {
+                params.companyId = companyId;
+            }
             return new Ext.Promise(function (resolve, reject) {
 				Ext.Ajax.request({
                     url: '/api/auth/authorize',
-                    params: {
-                        username: username,
-                        password: password
-                    },
+                    params: params,
                     method: 'POST',
                     success: function (response) {
                         var res = Ext.decode(response.responseText);

+ 6 - 1
frontend/saas-web/app/model/document/ProductDetail.js

@@ -10,6 +10,11 @@ Ext.define('saas.model.document.ProductDetail', {
         { name: 'pd_whid', type: 'int' },
         { name: 'pd_price', type: 'float' },
         { name: 'pd_amount', type: 'float' },
-        { name: 'pd_num', type: 'float' }
+        { name: 'pd_num', type: 'float' },
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/document/customeraddress.js

@@ -7,6 +7,11 @@ Ext.define('saas.model.document.customeraddress', {
         { name: 'ca_person', type: 'string' },
         { name: 'ca_phone', type: 'string' },
         { name: 'ca_default', type: 'string' },
-        { name: 'ca_cuid', type: 'int' }
+        { name: 'ca_cuid', type: 'int' },
+        { name: 'ca_text1', type: 'string' },
+        { name: 'ca_text2', type: 'string' },
+        { name: 'ca_text3', type: 'string' },
+        { name: 'ca_text4', type: 'string' },
+        { name: 'ca_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/document/customercontact.js

@@ -8,6 +8,11 @@ Ext.define('saas.model.document.customercontact', {
         { name: 'cc_qq', type: 'string' },
         { name: 'cc_email', type: 'string' },
         { name: 'cc_default', type: 'string' },
-        { name: 'cc_cuid', type: 'int' }
+        { name: 'cc_cuid', type: 'int' },
+        { name: 'cc_text1', type: 'string' },
+        { name: 'cc_text2', type: 'string' },
+        { name: 'cc_text3', type: 'string' },
+        { name: 'cc_text4', type: 'string' },
+        { name: 'cc_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/document/stocking.js

@@ -13,6 +13,11 @@ Ext.define('saas.model.document.stocking', {
         { name: 'st_whname', type: 'string' },
         { name: 'st_batchqty', type: 'float' },
         { name: 'st_actqty', type: 'float' },
-        { name: 'st_num', type: 'float' }
+        { name: 'st_num', type: 'float' },
+        { name: 'st_text1', type: 'string' },
+        { name: 'st_text2', type: 'string' },
+        { name: 'st_text3', type: 'string' },
+        { name: 'st_text4', type: 'string' },
+        { name: 'st_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/document/vendorcontact.js

@@ -8,6 +8,11 @@ Ext.define('saas.model.document.vendorcontact', {
         { name: 'vc_qq', type: 'string' },
         { name: 'vc_email', type: 'string' },
         { name: 'vc_default', type: 'string' },
-        { name: 'vc_veid', type: 'int' }
+        { name: 'vc_veid', type: 'int' },
+        { name: 'vc_text1', type: 'string' },
+        { name: 'vc_text2', type: 'string' },
+        { name: 'vc_text3', type: 'string' },
+        { name: 'vc_text4', type: 'string' },
+        { name: 'vc_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/money/RecBalance1.js

@@ -10,6 +10,11 @@ Ext.define('saas.model.money.RecBalance1', {
         { name: 'rd_amount', type: 'float' },
         { name: 'rd_paymethod', type: 'string' },
         { name: 'rd_paycode', type: 'string' },
-        { name: 'rd_remark', type: 'string' }
+        { name: 'rd_remark', type: 'string' },
+        { name: 'rd_text1', type: 'string' },
+        { name: 'rd_text2', type: 'string' },
+        { name: 'rd_text3', type: 'string' },
+        { name: 'rd_text4', type: 'string' },
+        { name: 'rd_text5', type: 'string' },
     ]
 });

+ 6 - 1
frontend/saas-web/app/model/money/RecBalance2.js

@@ -10,6 +10,11 @@ Ext.define('saas.model.money.RecBalance2', {
         { name: 'rbd_sldate', type: 'date' },
         { name: 'rbd_amount', type: 'float' },
         { name: 'rbd_nowbalance', type: 'float' },
-        { name: 'rbd_remark', type: 'string' }
+        { name: 'rbd_remark', type: 'string' },
+        { name: 'rbd_text1', type: 'string' },
+        { name: 'rbd_text2', type: 'string' },
+        { name: 'rbd_text3', type: 'string' },
+        { name: 'rbd_text4', type: 'string' },
+        { name: 'rbd_text5', type: 'string' },
     ]
 });

+ 5 - 0
frontend/saas-web/app/model/sale/SaleInDetail.js

@@ -49,6 +49,11 @@ Ext.define('saas.model.sale.SaleInDetail', {
         { name: 'pd_ordercode', type: 'string' }, // 销售单号
         { name: 'pd_orderdetno', type: 'int' }, // 销售序号
         { name: 'pd_remark', type: 'string' }, // 备注
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' },
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]

+ 5 - 0
frontend/saas-web/app/model/sale/SaleOutDetail.js

@@ -48,6 +48,11 @@ Ext.define('saas.model.sale.SaleOutDetail', {
         { name: 'pd_ordercode', type: 'string' }, // 销售单号
         { name: 'pd_orderdetno', type: 'string' }, // 销售序号
         { name: 'pd_remark', type: 'string' }, // 备注
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' },
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]

+ 5 - 0
frontend/saas-web/app/model/sale/Saledetail.js

@@ -44,6 +44,11 @@ Ext.define('saas.model.sale.Saledetail', {
         },
         { name: 'sd_delivery', type: 'date' }, // 交货日期
         { name: 'sd_remark', type: 'string' }, // 备注
+        { name: 'sd_text1', type: 'string' },
+        { name: 'sd_text2', type: 'string' },
+        { name: 'sd_text3', type: 'string' },
+        { name: 'sd_text4', type: 'string' },
+        { name: 'sd_text5', type: 'string' },
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]

+ 8 - 1
frontend/saas-web/app/model/stock/Makematerial.js

@@ -16,6 +16,13 @@ Ext.define('saas.model.stock.Makematerial', {
         { name: 'mm_qty', type: 'float' },
         { name: 'mm_amount', type: 'float' },
         { name: 'mm_repprodcode', type: 'string' },
-        { name: 'mm_remark', type: 'string' }],
+        { name: 'mm_remark', type: 'string' },
+        { name: 'mm_text1', type: 'string' },
+        { name: 'mm_text2', type: 'string' },
+        { name: 'mm_text3', type: 'string' },
+        { name: 'mm_text4', type: 'string' },
+        { name: 'mm_text5', type: 'string' }
+    ],
+        
     associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]        
 });

+ 0 - 39
frontend/saas-web/app/model/stock/ProdIODetail.js

@@ -1,39 +0,0 @@
-Ext.define('saas.model.stock.ProdIODetail', {
-    extend: 'saas.model.Base',
-
-    fields: [
-
-        { name: 'id', type: 'int' },
-        { name: 'pd_piid', type: 'int' },
-        { name: 'pd_inoutno', type: 'string' },
-        { name: 'pd_piclass', type: 'string' },
-        { name: 'pd_pdno', type: 'int' },
-        { name: 'pd_ordercode', type: 'string' },
-        { name: 'pd_orderdetno', type: 'int' },
-        { name: 'pd_prodid', type: 'int' },
-        { name: 'pd_prodcode', type: 'string' },
-        { name: 'pd_unit', type: 'string' },
-        { name: 'pd_inqty', type: 'float' },
-        { name: 'pd_outqty', type: 'float' },
-        { name: 'pd_orderprice', type: 'float' },
-        { name: 'pd_sendprice', type: 'float' },
-        { name: 'pd_price', type: 'float' },
-        { name: 'pd_total', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_netprice', type: 'float' },
-        { name: 'pd_nettotal', type: 'float' },
-        { name: 'pd_whid', type: 'int' },
-        { name: 'pd_whcode', type: 'string' },
-        { name: 'pd_whname', type: 'string' },
-        { name: 'pd_inwhid', type: 'int' },
-        { name: 'pd_inwhcode', type: 'string' },
-        { name: 'pd_inwhname', type: 'string' },
-        { name: 'pd_orderid', type: 'int' },
-        { name: 'pd_sdid', type: 'int' },
-        { name: 'pd_status', type: 'string' },
-        { name: 'pd_ym', type: 'int' },
-        { name: 'pd_yqty', type: 'float' },
-        { name: 'pd_remark', type: 'string' },
-        { name: 'pd_ioid', type: 'int' },
-    ]
-});

+ 40 - 19
frontend/saas-web/app/util/BaseUtil.js

@@ -56,26 +56,26 @@ Ext.define('saas.util.BaseUtil', {
          */
         showSuccessToast: function (content, title, configs) {
             Ext.toast(Ext.Object.merge({
-                cls:'x-toast-success',
+                cls: 'x-toast-success',
                 html: content,
                 title: title,
                 closable: false,
                 align: 't',
-                autoCloseDelay:3000,
-                autoClose:true,
+                autoCloseDelay: 3000,
+                autoClose: true,
                 maxWidth: 400
             }, configs));
         },
 
         showErrorToast: function (content, title, configs) {
             Ext.toast(Ext.Object.merge({
-                cls:'x-toast-error',
+                cls: 'x-toast-error',
                 html: content,
                 title: title,
                 closable: false,
                 align: 't',
-                autoCloseDelay:3000,
-                autoClose:true,
+                autoCloseDelay: 3000,
+                autoClose: true,
                 maxWidth: 400
             }, configs));
         },
@@ -143,13 +143,13 @@ Ext.define('saas.util.BaseUtil', {
         request: function (config) {
             var url = config.url,
                 params = config.params,
-                async = Ext.isBoolean(config.async) ? config.async : true,
-                    method = config.method || 'GET',
-                    timeout = config.timeout || 8000,
-                    defaultHeaders = {
-                        'Access-Control-Allow-Origin': '*',
-                        "Content-Type": 'application/json;charset=UTF-8'
-                    };
+                async = (Ext.isBoolean(config.async) ? config.async : true),
+                method = config.method || 'GET',
+                timeout = config.timeout || 8000,
+                defaultHeaders = {
+                    'Access-Control-Allow-Origin': '*',
+                    "Content-Type": 'application/json;charset=UTF-8'
+                };
             return new Ext.Promise(function (resolve, reject) {
                 Ext.Ajax.request({
                     url: url,
@@ -163,13 +163,21 @@ Ext.define('saas.util.BaseUtil', {
                         if (res.success) {
                             return resolve(res);
                         } else {
-                            console.error('failure message: ' + res.message);
+                            res.message = res.message || '未知错误';
                             return reject(res);
                         }
                     },
                     failure: function (response, opts) {
-                        console.error('server-side failure.', response);
-                        return reject(response);
+                        var res;
+
+                        try{
+                            res = JSON.parse(response.responseText);
+                        }catch(e) {
+                            res = response.responseJson || {};
+                        }
+                        console.error('ajax request failure: ', res);
+                        res.message = res.message || '未知错误';
+                        throw new Error(res.message);
                     }
                 });
             })
@@ -181,16 +189,29 @@ Ext.define('saas.util.BaseUtil', {
          * @param decimalPrecision: 最大小数位数
          * @param thousandSeparator: 显示千分位分隔符
          */
-        numberFormat: function(value, decimalPrecision, thousandSeparator) {
+        numberFormat: function (value, decimalPrecision, thousandSeparator) {
             value = Number(value) || 0;
             decimalPrecision = Ext.isNumber(decimalPrecision) ? decimalPrecision : 2;
             thousandSeparator = !!thousandSeparator;
-            
+
             var f1 = thousandSeparator ? '0,000' : '0';
             var arr = (value + '.').split('.');
             var xr = (new Array(arr[1].length > decimalPrecision ? decimalPrecision : arr[1].length)).fill('0');
             var format = f1 + '.' + xr.join('');
             return Ext.util.Format.number(value, format);
-        }
+        },
+
+        showLoginWin: function() {
+            var main = Ext.getCmp('rootView'),
+            win = Ext.getCmp('relogin');
+
+            if(!win) {
+                win = main.add({
+                    xtype: 'relogin'
+                });
+            }
+
+            win.show();
+        },
     }
 });

+ 239 - 114
frontend/saas-web/app/util/FormUtil.js

@@ -2,35 +2,29 @@ Ext.define('saas.util.FormUtil', {
 
     statics: {
 
-        // 请求页面组件接口模板
-        baseUrl: '/api/ui/co_view/config?name={viewName}',
-        // 保存自定义配置
-        // saveUrl: '/api/ui/co_view/config?name={viewName}',
-        // 模板替换正则
-        urlRe: /(.*){viewName}(.*)/g,
+        // 主表允许自定义的配置名
+        MAIN_ALLOW_CUS_FIELDS: ['fieldLabel', 'hidden', 'index', 'columnWidth', 'group', 'html'],
+        // 从表允许自定义的配置名
+        DETAIL_ALLOW_CUS_FIELDS: ['text', 'hidden', 'index', 'width'],
 
         setItems: function(form) {
             let me = this,
-            defaultItems;
-            
             defaultItems = form.defaultItems;
 
-            me.applyCusItemConfig(form)
-            .then(function(res) {
-                if(res.success) {
-                    let config = res.data || true, items = defaultItems || [];
-                    if(config) {
-                        let cusItems = config.items || [];
-                        Ext.Array.each(cusItems, function(cusItem) {
-                            let item = items.find(function(item) {
-                                return item.name == cusItem.name;
-                            });
-                            Ext.apply(item, cusItem);
-                        });
-                        items = me.applyDefaultItems(form, items);
+            saas.util.ViewUtil.getViewConfig(form.viewName)
+            .then(function(cfg) {
+                if(cfg) {
+                    let items = [];
+
+                    items = me.applyItemsGroup(defaultItems || []);
+                    items = me.initItems(items);
+                    items = me.applyCusMainItemConfig(items, cfg);
+                    items = me.applyCusDetailItemConfig(items, cfg);
+
+                    form.configItems = items;
+
+                    items = me.applyDefaultItems(form, items);
 
-                        items = me.applyItemsGroup(items);
-                    }
                     form.removeAll();
                     return form.addItems(items);
                 }else {
@@ -43,25 +37,230 @@ Ext.define('saas.util.FormUtil', {
             .then(function() {
                 me.loadData(form);
             })
-            .catch(function(response) {
-                saas.util.BaseUtil.showErrorToast('加载数据错误:' + response.message);
-                console.error(response);
+
+        },
+
+        applyItemsGroup: function(items) {
+            let groups = [],
+            groupCount = 0,
+            newItems = [];
+
+            Ext.Array.each(items, function(it, index) {
+                let item = Object.assign({}, it),
+                groupName = item.group;
+                if(!!groupName) {
+                    let idx = groups.findIndex(function(g) {
+                        return g.title == groupName;
+                    }),group;
+
+                    if(idx == -1) {
+                        group = {
+                            title: groupName,
+                            count: 1
+                        };
+                        groups.push(group);
+                    }else {
+                        group = groups[idx];
+                        group.count++;
+                    }
+                }
+                newItems.push(item);
+            });
+
+            Ext.Array.sort(newItems, function(a, b) {
+                let gs = groups.concat([{
+                    title: '_nogroup'
+                }]);
+                a.group = a.group || '_nogroup';
+                let v1 = gs.findIndex(function(g) {
+                    return g.title == a.group;
+                })
+                let v2 = gs.findIndex(function(g) {
+                    return g.title == b.group;
+                })
+                return v1 - v2;
+            });
+
+            Ext.Array.each(groups, function(g) {
+                let idx = newItems.findIndex(function(i) {
+                    return i.group == g.title;
+                });
+                g.index = idx;
             });
 
+            Ext.Array.each(groups, function(group, index) {
+                let formIndex = group.index;
+                delete group.index;
+                Ext.Array.insert(newItems, formIndex + index, [{
+                    xtype: 'separatefield',
+                    name: 'group' + (++groupCount),
+                    html: group.title,
+                    fieldLabel: group.title || '分组' + groupCount
+                }]);
+            });
+
+            return newItems;
         },
 
-        /**
-         * 获得form的客户自定义字段配置
-         * @param form: form组件
-         * @param url: url
-         */
+        initItems: function(items) {
+            let itemCount = detailCount = 1, newItems = [];
+            Ext.Array.each(items, function(it, i) {
+                let item = Object.assign({}, it);
+                if(item.xtype == 'detailGridField') {
+                    let columns = item.columns,
+                    colCount = 1;
+                    Ext.Array.each(columns, function(col, j) {
+                        if((col.hidden || col.width == 0 || !col.dataIndex) && (!col.hasOwnProperty('initHidden') || col.initHidden)) {
+                            Ext.applyIf(col, {
+                                index: -1,
+                                initHidden: true
+                            });
+                        }else {
+                            Ext.applyIf(col, {
+                                text: '',
+                                hidden: false,
+                                index: colCount++,
+                                allowBlank: true,
+                                width: 100,
+                                initHidden: false
+                            });
+                        }
+                    });
+                    if(!columns[columns.length - 1].flex) {
+                        columns.push({
+                            dataIndex: '',
+                            initHidden: true,
+                            flex: 1,
+                            allowBlank: true
+                        });
+                    }
+                    Ext.applyIf(item, {
+                        allowBlank: false,
+                        columnWidth: 1,
+                        gname: 'detail' + detailCount,
+                        fieldLabel: '从表' + (detailCount++),
+                    });
+                }else if(item.xtype == 'hidden') {
+                    Ext.applyIf(item, {
+                        fieldLabel: '',
+                        hidden: true,
+                        initHidden: true,
+                    });
+                }else if(item.xtype == 'separatefield') {
+                    Ext.applyIf(item, {
+                        fieldLabel: item.html,
+                        columnWidth: 1,
+                    });
+                }else {
+                    Ext.applyIf(item, {
+                        fieldLabel: '',
+                        columnWidth: 0.25,
+                    });
+                }
+
+                if(item.hidden) {
+                    if(item.initHidden || !item.hasOwnProperty('initHidden')) {
+                        Ext.applyIf(item, {
+                            index: -1,
+                            initHidden: true
+                        });
+                    }else {
+                        Ext.applyIf(item, {
+                            index: itemCount++,
+                            initHidden: false
+                        }); 
+                    }
+                }else {
+                    Ext.applyIf(item, {
+                        index: itemCount++,
+                        initHidden: false
+                    });
+                }
+
+                Ext.applyIf(item, {
+                    name: 'item' + i,
+                    hidden: false,
+                    allowBlank: true,
+                    group: undefined,
+                });
+
+                newItems.push(item);
+            });
+
+            Ext.Array.sort(newItems, function(a, b) {
+                return a.index - b.index;
+            });
 
-        applyCusItemConfig: function(form) {
+            return newItems;
+        },
+
+        // 将自定义配置应用到默认items
+        applyCusMainItemConfig: function(items, cfg) {
             let me = this,
-            viewName = form.viewName,
-            defaultItems = form.defaultItems,
-            url = me.baseUrl.replace(me.urlRe, '$1' + viewName);
-            return saas.util.BaseUtil.request({url, async: false});
+            cusMainItems = cfg.main || [];
+
+            Ext.Array.each(cusMainItems, function(cusItem) {
+                let item = Ext.Array.findBy(items, function(item) {
+                    return item.name == cusItem.name;
+                });
+                if(!!item) {
+                    let keys = Ext.Object.getAllKeys(cusItem);
+                    keys.map(function(k) {
+                        if(me.MAIN_ALLOW_CUS_FIELDS.indexOf(k) != -1) {
+                            if(k != 'hidden' || item.allowBlank) {
+                                item['_init_' + k] = item.hasOwnProperty('_init_' + k) ? item['_init_' + k] : item[k]; 
+                                item[k] = cusItem[k];
+                            }
+                        }
+                    });
+                    
+                }
+            });
+
+            Ext.Array.sort(items, function(a, b) {
+                return a.index - b.index;
+            });
+
+            return items;
+        },
+
+        // 将自定义配置应用到从表items
+        applyCusDetailItemConfig: function(items, cfg) {
+            let me = this,
+            detailCount = 1;
+
+            Ext.Array.each(items, function(item) {
+                let gname = item.gname;
+
+                if(item.xtype == 'detailGridField' && cfg.hasOwnProperty(gname)) {
+                    let columns = item.columns,
+                    cusColumns = cfg[gname] || [];
+
+                    Ext.Array.each(cusColumns, function(cusCol) {
+                        let col = Ext.Array.findBy(columns, function(col) {
+                            return col.dataIndex == cusCol.dataIndex;
+                        });
+                        if(!!col) {
+                            let keys = Ext.Object.getAllKeys(cusCol);
+                            keys.map(function(k) {
+                                if(me.DETAIL_ALLOW_CUS_FIELDS.indexOf(k) != -1) {
+                                    if(k != 'hidden' || col.allowBlank) {
+                                        col['_init_' + k] = col.hasOwnProperty('_init_' + k) ? col['_init_' + k] : col[k]; 
+                                        col[k] = cusCol[k];
+                                    }
+                                }
+                            });
+                            
+                        }
+                    });
+
+                    Ext.Array.sort(columns, function(a, b) {
+                        return a.index - b.index;
+                    });
+                }
+            });
+
+            return items;
         },
 
         /**
@@ -167,13 +366,6 @@ Ext.define('saas.util.FormUtil', {
                         }
                     });
 
-                    if(columns[columns.length - 1].flex != 1) {
-                        columns.push({
-                            flex: 1,
-                            allowBlank: true
-                        });
-                    }
-
                     cnames.push(item.detnoColumn);
 
                     formModel.set('detail' + index + '.detailBindFields', cnames);
@@ -207,72 +399,6 @@ Ext.define('saas.util.FormUtil', {
             return items;
         },
 
-        applyItemsGroup: function(items) {
-            let groups = [];
-
-            Ext.Array.each(items, function(item, index) {
-                let groupName = item.group;
-                if(!!groupName) {
-                    let idx = groups.findIndex(function(g) {
-                        return g.title == groupName;
-                    }),group;
-
-                    if(idx == -1) {
-                        group = {
-                            title: groupName,
-                            count: 1
-                        };
-                        groups.push(group);
-                    }else {
-                        group = groups[idx];
-                        group.count++;
-                    }
-                }
-            });
-
-            Ext.Array.sort(items, function(a, b) {
-                let gs = groups.concat([{
-                    title: '_nogroup'
-                }]);
-                a.group = a.group || '_nogroup';
-                let v1 = gs.findIndex(function(g) {
-                    return g.title == a.group;
-                })
-                let v2 = gs.findIndex(function(g) {
-                    return g.title == b.group;
-                })
-                return v1 - v2;
-            });
-
-            Ext.Array.each(groups, function(g) {
-                let idx = items.findIndex(function(i) {
-                    return i.group == g.title;
-                });
-                g.index = idx;
-            });
-
-            Ext.Array.each(groups, function(group, index) {
-                let formIndex = group.index;
-                delete group.index;
-                Ext.Array.insert(items, formIndex + index, [{
-                    xtype: 'container',
-                    userCls: 'x-field-separator',
-                    height: 36,
-                    html: group.title,
-                    columnWidth: 1,
-                    ignore: true,
-                    isValid: function() {
-                        return true;
-                    },
-                    isDirty: function() {
-                        return false;
-                    }
-                }]);
-            });
-
-            return items;
-        },
-
         loadData: function(form) {
             let me = this;
             form.setLoading(true);
@@ -299,10 +425,9 @@ Ext.define('saas.util.FormUtil', {
                         form.fireEvent('load', form, o);
                     }
                 })
-                .catch(function(response) {
+                .catch(function(e) {
                     form.setLoading(false);
-                    console.error(response);
-                    saas.util.BaseUtil.showErrorToast(response.message);
+                    saas.util.BaseUtil.showErrorToast('读取单据数据错误: ' + e.message);
                 });
             }else{
                 //取后台编号
@@ -362,10 +487,10 @@ Ext.define('saas.util.FormUtil', {
                         form.initFormData(formData);
                         form.fireEvent('load', form, formData);
                     }
-                }).catch(function(res) {
+                }).catch(function(e) {
                     form.clearDirty();
-                    saas.util.BaseUtil.showErrorToast(res.message);
                     form.setLoading(false);
+                    saas.util.BaseUtil.showErrorToast('请求单据编号错误: ' + e.message);
                 })
             }
         }

+ 139 - 0
frontend/saas-web/app/util/ViewUtil.js

@@ -0,0 +1,139 @@
+Ext.define('saas.util.ViewUtil', {
+    statics: {
+
+        // 请求页面组件接口模板
+        getCfgUrl: '/api/ui/customize/getConfig?name={viewName}',
+        // 保存自定义配置
+        saveCfgUrl: '/api/ui/customize/saveConfig',
+        // 模板替换正则
+        urlRe: /(.*){viewName}(.*)/g,
+        // 从表允许自定义的配置名
+        DETAIL_ALLOW_CUS_FIELDS: ['text', 'hidden', 'index', 'width'],
+
+        getViewConfig: function (viewName) {
+            let me = this,
+                url = me.getCfgUrl.replace(me.urlRe, '$1' + viewName);
+            return saas.util.BaseUtil.request({
+                    url,
+                    async: false
+                })
+                .then(function (res) {
+                    let cfg = me.decodeViewConfig(res.data);
+                    return cfg;
+                })
+                .catch(function (e) {
+                    saas.util.BaseUtil.showErrorToast('读取界面配置失败:' + e.message);
+                    return null;
+                });
+        },
+
+        decodeViewConfig: function (cfgs) {
+            cfgs = cfgs || [];
+            let cfg = {};
+            for (let i = 0; i < cfgs.length; i++) {
+                let c = cfgs[i],
+                    pos = c.position;
+                if (pos) {
+                    cfg[pos] = JSON.parse(c.content);
+                }
+            }
+
+            return cfg;
+        },
+
+        applyColumns: function (viewName, columns) {
+            let me = this;
+
+            return me.getViewConfig(viewName)
+                .then(function (cfg) {
+                    let newColumns = [];
+
+                    newColumns = me.initColumnItems(columns);
+                    if (cfg) {
+                        return me.applyColumnConfig(newColumns, cfg['columns']);
+                    } else {
+                        return newColumns;
+                    }
+                });
+        },
+
+        /**
+         * 为列字段添加可能会被自定义的初始化配置
+         */
+        initColumnItems: function (columns) {
+            columns = Ext.isArray(columns) ? columns : [];
+            let colCount = 1,
+                newColumns = [];
+
+            Ext.Array.each(columns, function (c, j) {
+                let col = Object.assign({}, c);
+                if (col.hidden || col.width == 0 || !col.dataIndex) {
+                    Ext.applyIf(col, {
+                        index: -1,
+                        initHidden: true
+                    });
+                } else {
+                    Ext.applyIf(col, {
+                        text: '',
+                        hidden: false,
+                        index: colCount++,
+                        allowBlank: true,
+                        width: 100,
+                        initHidden: false
+                    });
+                }
+                newColumns.push(col);
+            });
+
+            Ext.Array.sort(newColumns, function (a, b) {
+                return a.index - b.index;
+            });
+
+            return newColumns;
+        },
+
+        /**
+         * 应用自定义配置到列字段
+         */
+        applyColumnConfig: function (columns, cusColumns) {
+            let me = this;
+
+            Ext.Array.each(cusColumns, function (cusCol) {
+                let col = Ext.Array.findBy(columns, function (col) {
+                    return col.dataIndex == cusCol.dataIndex;
+                });
+                if (!!col) {
+                    let keys = Ext.Object.getAllKeys(cusCol);
+                    keys.map(function (k) {
+                        if (me.DETAIL_ALLOW_CUS_FIELDS.indexOf(k) != -1) {
+                            if (k != 'hidden' || col.allowBlank) {
+                                col['_init_' + k] = col.hasOwnProperty('_init_' + k) ? col['_init_' + k] : col[k];
+                                col[k] = cusCol[k];
+                            }
+                        }
+                    });
+
+                }
+            });
+
+            Ext.Array.sort(columns, function (a, b) {
+                return a.index - b.index;
+            });
+
+            return columns;
+        },
+
+        saveViewConfig: function (name, position, content) {
+            let me = this;
+            return saas.util.BaseUtil.request({
+                url: me.saveCfgUrl,
+                params: JSON.stringify({
+                    name: name,
+                    position: position,
+                    content: JSON.stringify(content)
+                }),
+                method: 'POST',
+            });
+        }
+    }
+});

+ 24 - 23
frontend/saas-web/app/view/auth/LoginController.js

@@ -2,22 +2,23 @@ Ext.define('saas.view.auth.LoginController', {
     extend: 'Ext.app.ViewController',
     alias: 'controller.login',
 
-    init: function() {
+    init: function () {
         this.callParent(arguments);
     },
 
-    onLoginButton: function() {
-        var me = this, view = me.getView(),
+    onLoginButton: function () {
+        var me = this,
+            view = me.getView(),
             form = me.lookup('authdialog'),
             values = form.getValues();
         view.mask('请稍等...');
 
         saas.model.Session.login(values.username, values.password)
-            .then(function(session) {
+            .then(function (session) {
                 view.isMasked() && view.unmask();
                 me.getViewModel().set('session', session);
                 var cos = session.get("account").companies;
-				if (cos && cos.length) {
+                if (cos && cos.length) {
                     if (cos.length == 1) {
                         session.get('account').companyId = cos[0].id;
                         me.fireEvent('login', session);
@@ -33,40 +34,40 @@ Ext.define('saas.view.auth.LoginController', {
                             }
                         });
                     }
-				} else {
+                } else {
                     me.fireEvent('login', session);
                 }
             })
-            .catch(function(error) {
+            .catch(function (error) {
                 view.isMasked() && view.unmask();
-                saas.util.BaseUtil.showErrorToast(error.message);
+                saas.util.BaseUtil.showErrorToast('登录失败: ' + error.message);
             });
     },
 
-    onWeixinLogin : function() {
-    },
+    onWeixinLogin: function () {},
 
-    onNewAccount:  function() {
-    },
+    onNewAccount: function () {},
 
-    selectCompany: function(view, record) {
-        var me = this, view = me.getView(), oldSession = me.getViewModel().get('session'),
+    selectCompany: function (view, record) {
+        var me = this,
+            view = me.getView(),
+            oldSession = me.getViewModel().get('session'),
             companyId = record.get('id');
-        
+
         view.mask('请稍等...');
 
         saas.model.Session.switchCompany(oldSession, companyId)
-            .then(function(newSession) {
+            .then(function (newSession) {
                 newSession.get('account').companyId = companyId;
-				me.fireEvent('login', newSession);
+                me.fireEvent('login', newSession);
             })
-            .catch(function(error) {
-                saas.util.BaseUtil.showErrorToast(error.message);
-            })
-            .then(function() {
+            .then(function () {
                 view.isMasked() && view.unmask();
                 view.close();
-                view.ownerCt.destroy();
+                view.ownerCt && view.ownerCt.destroy();
+            })
+            .catch(function (error) {
+                saas.util.BaseUtil.showErrorToast('切换账套失败: ' + error.message);
             });
     }
-});
+});

+ 103 - 0
frontend/saas-web/app/view/auth/ReLogin.js

@@ -0,0 +1,103 @@
+/**
+ * 重新登录弹窗
+ */
+Ext.define('saas.view.auth.ReLogin', {
+    extend: 'Ext.window.Window',
+    xtype: 'relogin',
+    id: 'relogin',
+
+    controller: 'relogin',
+
+    title: '重新登录',
+    cls: 'x-window-dbfind x-relogin-win',
+    layout: 'fit',
+    modal: true,
+    width: 350,
+    bodyPadding: 20,
+
+    items: [{
+        xtype: 'form',
+        reference: 'reloginform',
+        defaults: {
+            anchor: '100%',
+            labelWidth: 120
+        },
+        items: [{
+            xtype: 'displayfield',
+            height: 32,
+            cls: 'infoLabel',
+            value: '会话已过期,请重新登录',
+        }, {
+            xtype: 'textfield',
+            name: 'username',
+            emptyText: '请输入账号/邮箱/手机号',
+            fieldLabel: '账号',
+            bind: '{account.username}',
+            readOnly: true,
+            hideLabel: true,
+            allowBlank: false
+        }, {
+            xtype: 'textfield',
+            hideLabel: true,
+            fieldLabel: '密码',
+            emptyText: '密码',
+            inputType: 'password',
+            name: 'password',
+            // bind: '{password}',
+            allowBlank: false,
+            enableKeyEvents: true,
+            listeners: {
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            this.up('relogin').getController().onLogin();
+                        }
+                    }
+                }
+            }
+        }, {
+            xtype: 'container',
+            layout: 'hbox',
+            items: [{
+                xtype: 'checkboxfield',
+                flex: 1,
+                cls: 'form-panel-font-color rememberMeCheckbox',
+                height: 30,
+                name: 'remember',
+                bind: '{remember}',
+                boxLabel: '记住密码'
+            }, {
+                xtype: 'box',
+                // html: '<a href="#passwordreset" class="link-forgot-password"> 忘记密码 ?</a>'
+            }]
+        }, {
+            xtype: 'container',
+            layout: {
+                type: 'hbox',
+                pack: 'center'
+            },
+            items: [{
+                xtype: 'button',
+                text: '登录',
+                formBind: true,
+                width: 68,
+                margin: '0 12 0 0',
+                listeners: {
+                    click: 'onLogin'
+                }
+            }, {
+                xtype: 'button',
+                text: '取消',
+                width: 68,
+                margin: '0 0 0 12',
+                listeners: {
+                    click: 'onCancel'
+                }
+            }]
+        }]
+    }],
+
+    listeners: {
+        afterrender: 'onAfterRender',
+    }
+});

+ 15 - 0
frontend/saas-web/app/view/auth/ReLogin.scss

@@ -0,0 +1,15 @@
+.x-relogin-win {
+    .infoLabel {
+        .x-form-display-field {
+            font-size: 14px;
+            vertical-align: middle;
+            line-height: 32px;
+            color: red;
+        }
+    }
+    .rememberMeCheckbox {
+        .x-form-checkbox-default,.x-form-cb-label-default.x-form-cb-label-after {
+            margin: 0;
+        }
+    }
+}

+ 103 - 0
frontend/saas-web/app/view/auth/ReLoginController.js

@@ -0,0 +1,103 @@
+Ext.define('saas.view.auth.ReLoginController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.relogin',
+
+    init: function () {
+        this.callParent(arguments);
+    },
+
+    onAfterRender: function() {
+        var me = this,
+        view = me.getView(),
+        model = me.getViewModel(),
+        remember = model.get('remember'),
+        password = model.get('repassword'),
+        lastSuccess = model.get('lastSuccess'),
+        form = me.lookup('reloginform'),
+        passwordField = form.getForm().findField('password');
+
+        if(remember && lastSuccess) {
+            passwordField.setValue(password);
+        }
+    },
+
+    onLogin: function () {
+        var me = this,
+            view = me.getView(),
+            viewModel = me.getViewModel(),
+            companyId = saas.util.BaseUtil.getCurrentUser().companyId,
+            form = me.lookup('reloginform'),
+            values = form.getValues();
+
+        if(!form.isValid()) {
+            return;
+        }
+
+        view.mask('请稍等...');
+
+        saas.model.Session.login(values.username, values.password, companyId)
+        .then(function (session) {
+            view.isMasked() && view.unmask();
+            viewModel.set('session', session);
+
+            session.get('account').companyId = companyId;
+            
+            me.successReLogin();
+            me.fireEvent('login', session);
+            return session;
+        })
+        .then(function(session) {
+            let headers = Ext.Ajax.getDefaultHeaders() || {};
+            
+            headers['Authorization'] = session.data.token;
+            Ext.Ajax.setDefaultHeaders(headers);
+
+            saas.util.State.set('session', session.data);
+
+            let sessionStr = session.data ? JSON.stringify(session.data) : '';
+
+            if (typeof require === 'function') {
+                let ipc = require('electron').ipcRenderer;
+                ipc.send('session.change', sessionStr);
+            }else {
+                //解析session 把data作为sessionStr
+                sessionStr = session ? JSON.stringify(session.data) : '';
+                const frame = window.frames[window.frames.length - 1];
+                frame.postMessage(sessionStr, '*');
+            }
+            return session;
+        })
+        .catch(function (error) {
+            view.isMasked() && view.unmask();
+            console.error(error);
+            saas.util.BaseUtil.showErrorToast('登录失败: ' + error.message);
+            me.failureReLogin();
+        });
+    },
+
+    successReLogin: function() {
+        var me = this,
+            view = me.getView(),
+            form = me.lookup('reloginform'),
+            values = form.getValues();
+            viewModel = me.getViewModel();
+
+        viewModel.set('repassword', values.password);
+        viewModel.set('lastSuccess', true);
+        view.close();
+    },
+
+    failureReLogin: function() {
+        var me = this,
+        viewModel = me.getViewModel();
+
+        viewModel.set('lastSuccess', false);
+    },
+
+    onCancel: function() {
+        var me = this,
+        view = me.getView();
+
+        view.close();
+    },
+});

+ 14 - 2
frontend/saas-web/app/view/core/base/BasePanel.js

@@ -39,7 +39,7 @@ Ext.define('saas.view.core.base.BasePanel', {
         gridIdField = gridConfig.idField,
         gridCodeField = gridConfig.codeField,
         gridStatusCodeField = gridConfig.statusCodeField,
-        gridColumns = gridConfig.columns,
+        gridColumns = Ext.Array.clone(gridConfig.columns),
         deleteMsg = gridConfig.deleteMsg;
 
         Ext.apply(me, {
@@ -66,7 +66,9 @@ Ext.define('saas.view.core.base.BasePanel', {
                 dataUrl: gridDataUrl,
                 idField: gridIdField,
                 codeField: gridCodeField,
-                columns: gridColumns,
+                _columns: gridColumns.map(function(c) {
+                    return Object.assign({}, c);
+                }),
                 statusCodeField : gridStatusCodeField,
                 deleteMsg: deleteMsg
             }]
@@ -93,5 +95,15 @@ Ext.define('saas.view.core.base.BasePanel', {
                 });
             });
         }
+    },
+
+    refresh: function () {
+        this.items.items[0].store.load()
+    },
+
+    refreshViewConfig: function() {
+        var me = this;
+        var grid = me.items.items[0];
+        grid.refreshColumns();
     }
 });

+ 37 - 0
frontend/saas-web/app/view/core/base/BasePanelController.js

@@ -149,4 +149,41 @@ Ext.define('saas.view.core.base.BasePanelController', {
 
         return conditionValue;
     },
+
+    onColSetting: function() {
+        var me = this,
+        panel = me.getView(),
+        viewName = panel.viewName,
+        columns = panel.defaultColumns,
+        items = [];
+
+        for(let i = 0; i < columns.length; i++) {
+            let col = columns[i];
+            if(!col.initHidden) {
+                items.push(Object.assign({}, col));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, 'columns');
+    },
+
+    openSettingWindow: function(viewName, items, settype) {
+        var panel = saas.util.BaseUtil.getCurrentTab(),
+        box = panel.getBox(),
+        refs = panel.getReferences() || {},
+        win = refs.settingwin;
+
+        title = '列设置';
+
+        if(!win) {
+            win = panel.add({
+                title: title,
+                xtype: 'settingwin',
+                viewName: viewName,
+                fieldItems: Ext.Array.clone(items),
+                settype: settype,
+            });
+        }
+        win.show();
+    }
 });

+ 121 - 97
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -24,12 +24,39 @@ Ext.define('saas.view.core.base.GridPanel', {
     dbSearchFields: [],
     condition:'',
 
+    actionColumn: [{
+        xtype:'actioncolumn',
+        width:70,
+        dataIndex:'actioncolumn',
+        initHidden: true,
+        text:'操作',
+        align: 'center',
+        items: [{
+            tooltip: '编辑',
+            iconCls: 'x-fa fa-pencil fa-fw',
+            scope:this
+        },{
+            text:'删除',
+            iconCls:'x-fa fa-trash-o fa-fw',
+            tooltip: '删除',
+            scope:this
+        }]
+    }],
+
+    flexColumn: [{
+        flex: 1,
+        dataIndex:'',
+        initHidden: true,
+        allowBlank: true
+    }],
+
+
     initComponent: function() {
         var me = this;
         me.frame = false;
-        if(me.columns){
-            var fields = me.columns.map(column => column.dataIndex);
-            me.columns = me.insertFirstColumn(me.columns);
+        if(me._columns){
+            var fields = me._columns.map(column => column.dataIndex);
+
             me.store = Ext.create('Ext.data.Store',{
                 fields:fields,
                 autoLoad: true,
@@ -154,11 +181,84 @@ Ext.define('saas.view.core.base.GridPanel', {
                     dock: 'bottom',
                     cls:'x-basepanel-pagingtoolbar',
                     displayInfo: true,
-                    store: me.store
+                    store: me.store,
+                    items: [{
+                        iconCls: 'x-sa sa-setting',
+                        text: '列设置',
+                        handler: 'onColSetting',
+                        bind: {
+                            hidden: '{!isAdmin}'
+                        }
+                    }]
                 }]
             });
         }
         me.callParent(arguments);
+        me.refreshColumns();
+    },
+
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;//可能有滚动条
+            var pageSize = Math.floor(gridBodyBoxHeight / 33);
+            store.setPageSize(pageSize);
+        },
+        itemClick: function(view,record,a,index,c) {
+            var classList = c.target.classList.value;
+            var form = view.ownerCt.ownerCt;
+            if(classList.indexOf('fa-pencil')>-1){
+                var config = {};
+                config.initId = record.get('id');
+                saas.util.BaseUtil.openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
+            }else if(classList.indexOf('fa-trash-o')>-1){
+                //删除
+                var id = record.get('id');
+                if(id){
+                    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.showSuccessToast('删除成功');
+                                    view.ownerCt.store.load();
+                                }
+                            })
+                            .catch(function(e) {
+                                saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
+                            });
+                        }
+                    });
+                }
+            }
+        }
+    },
+
+    initColumns: function(columns) {
+        var me = this,
+        basePanel = me.up('core-base-basepanel'),
+        viewName = basePanel.viewName;
+
+        return saas.util.ViewUtil.applyColumns(viewName, columns)
+        .then(function(columns) {
+            basePanel.defaultColumns = me.defaultColumns = columns;
+            return columns;
+        });
+    },
+
+    refreshColumns: function() {
+        var me = this,
+        basePanel = me.up('core-base-basepanel');
+        me.initColumns(Ext.Array.clone(basePanel.gridConfig.columns)).then(function(columns) {
+            me.reconfigure(me.store, Ext.Array.merge(me.actionColumn, columns, me.flexColumn));
+            me.applyScrollable(true)
+        });
     },
 
     onLoad:function(){
@@ -214,8 +314,8 @@ Ext.define('saas.view.core.base.GridPanel', {
                 });
             }
         })
-        .catch(function(res) {
-            saas.util.BaseUtil.showErrorToast('导出失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('导出失败: ' + e.message);
         });
     },
 
@@ -230,98 +330,22 @@ Ext.define('saas.view.core.base.GridPanel', {
         if(data&&data.length>0){
             var params = JSON.stringify({baseDTOs:data});
             saas.util.BaseUtil.request({
-                    url: url,
-                    params: params,
-                    method: 'POST',
-                    async:false
-                })
-                .then(function() {
-                    saas.util.BaseUtil.showSuccessToast('操作成功');
-                    grid.store.load();
-                    grid.selModel.deselectAll();
-                })
-                .catch(function(res) {
-                    console.error(res);
-                    saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
-                });
-        }else{
-            saas.util.BaseUtil.showErrorToast('请勾选至少一条明</br>细。');
-        }
-    },
-
-    listeners:{
-        boxready: function(grid, width, height, eOpts) {
-            var store = grid.getStore(),
-            gridBodyBox = grid.body.dom.getBoundingClientRect(),
-            gridBodyBoxHeight = gridBodyBox.height;//可能有滚动条
-            var pageSize = Math.floor(gridBodyBoxHeight / 33);
-            store.setPageSize(pageSize);
-        },
-        itemClick: function(view,record,a,index,c) {
-            var classList = c.target.classList.value;
-            var form = view.ownerCt.ownerCt;
-            if(classList.indexOf('fa-pencil')>-1){
-                var config = {};
-                config.initId = record.get('id');
-                saas.util.BaseUtil.openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
-            }else if(classList.indexOf('fa-trash-o')>-1){
-                //删除
-                var id = record.get('id');
-                if(id){
-                    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.showSuccessToast('删除成功');
-                                    view.ownerCt.store.load();
-                                }
-                            })
-                            .catch(function(res) {
-                                console.error(res);
-                                saas.util.BaseUtil.showErrorToast('删除失败: ' + res.message);
-                            });
-                        }
-                    });
-                }
-            }
-        }
-    },
-    
-    insertFirstColumn:function(columns){
-        var me=this;
-        if(columns.length>0 && columns[0].xtype!='actioncolumn'){
-            Ext.Array.insert(columns,0,[{
-                xtype:'actioncolumn',
-                width:70,
-                dataIndex:'actioncolumn',
-                text:'操作',
-                align: 'center',
-                items: [{
-                    tooltip: '编辑',
-                    iconCls: 'x-fa fa-pencil fa-fw',
-                    scope:this
-                },{
-                    text:'删除',
-                    iconCls:'x-fa fa-trash-o fa-fw',
-                    tooltip: '删除',
-                    scope:this
-                }]
-            }]);
-        }
-        if(columns[columns.length - 1].flex != 1) {
-            columns.push({
-                flex: 1,
-                dataIndex:'virtual',
-                allowBlank: true
+                url: url,
+                params: params,
+                method: 'POST',
+                async:false
+            })
+            .then(function() {
+                saas.util.BaseUtil.showSuccessToast('操作成功');
+                grid.store.load();
+                grid.selModel.deselectAll();
+            })
+            .catch(function(e) {
+                saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
             });
+        }else{
+            saas.util.BaseUtil.showErrorToast('请勾选至少一条明细');
         }
-        return columns;
     },
 
     getGridSelected:function(type){
@@ -349,5 +373,5 @@ Ext.define('saas.view.core.base.GridPanel', {
             return false;
         }
 		return data;
-    } 
+    },
 });

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

@@ -46,7 +46,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         messageLogText:'操作日志'
     },
     initComponent: function () {
-        var me = this,
+        let me = this,
         auditTexts = me.auditTexts;
         me._deleteMsg = '删除的'+me._title+'将不能恢复,请确认是否删除?';
         me.initViewModel();
@@ -121,7 +121,15 @@ Ext.define('saas.view.core.form.FormPanel', {
                 hidden: '{!id}'
             },
             handler:"showMessageLog"
-        } ];
+        }, {
+            cls:'x-formpanel-btn-white',
+            text: '界面设置',
+            target: 'main',
+            handler: 'onSetting',
+            bind: {
+                hidden: '{!isAdmin}'
+            }
+        }];
 
         Ext.apply(me, {
             dockedItems: [{
@@ -139,13 +147,13 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     initFormItems: function() {
-        var me = this;
+        let me = this;
         saas.util.FormUtil.setItems(me);
     },
 
     getToolBarItems: function() {
-        var me = this, items = [];
-        var codeHeaderItems = [{
+        let me = this, items = [];
+        let codeHeaderItems = [{
             xtype: 'tbtext',
             bind: {
                 html: '<span class="x-tb x-no">NO. </span>' +
@@ -217,7 +225,7 @@ Ext.define('saas.view.core.form.FormPanel', {
      * 一些初始化viewModel的方法
      */
     initViewModel: function () {
-        var me = this,
+        let me = this,
         codeField = me._codeField,
         statusField = me._statusField,
         statusCodeField = me._statusCodeField,
@@ -231,7 +239,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         viewModel.set('creatorName', viewModel.get('account').realname);
 
         if (statusCodeField) {
-            var o = {};
+            let o = {};
             o['bindEditable'] = {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
@@ -254,10 +262,10 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     addItems: function (items) {
-        var me = this;
+        let me = this;
         me.setBindFields(items);
-        var formItems = me.add(items);
-        var codeField = me.getForm().findField(me._codeField);
+        let formItems = me.add(items);
+        let codeField = me.getForm().findField(me._codeField);
         if(codeField && !Ext.Array.findBy(formItems, function(i) {
             return i.name == me._codeField;
         })) {
@@ -271,7 +279,7 @@ Ext.define('saas.view.core.form.FormPanel', {
      * 获取form数据
      */
     getFormData: function () {
-        var me = this,
+        let me = this,
             viewModel = me.getViewModel(),
             allData = viewModel.getData(),
             bindFields = allData.base.bindFields,
@@ -280,22 +288,22 @@ Ext.define('saas.view.core.form.FormPanel', {
             detailGrids = me.query('detailGridField');
 
         Ext.Array.each(bindFields, function(field) {
-            var v = allData[field];
+            let v = allData[field];
             if(Ext.isDate(v)) {
                 v = Ext.Date.format(v, 'Y-m-d H:i:s');
             }
             formData[field] = v;
         });
 
-        var data = {
+        let data = {
             main: formData,
         };
 
-        for (var i = 0; i < detailCount; i++) {
-            var g = detailGrids[i];
-            var gridTrueData = g.getTrueData();
-            var modelDetail = allData['detail' + i];
-            var detailBindFields = modelDetail.detailBindFields;
+        for (let i = 0; i < detailCount; i++) {
+            let g = detailGrids[i];
+            let gridTrueData = g.getTrueData();
+            let modelDetail = allData['detail' + i];
+            let detailBindFields = modelDetail.detailBindFields;
 
             Ext.Array.each(gridTrueData, function(d) {
                 for(k in d) {
@@ -313,7 +321,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     setFormData: function (formData) {
-        var me = this,
+        let me = this,
         main = formData.main,
         detailCount = me.detailCount,
         viewModel = me.getViewModel(),
@@ -321,16 +329,16 @@ Ext.define('saas.view.core.form.FormPanel', {
 
         me.setMainData(main);
 
-        var detailGrids = me.query('detailGridField');
+        let detailGrids = me.query('detailGridField');
 
-        for (var i = 0; i < detailGrids.length; i++) {
-            var detailData = formData['detail' + i] || [];
+        for (let i = 0; i < detailGrids.length; i++) {
+            let detailData = formData['detail' + i] || [];
             me.setDetailData(detailData, i);
         }
     },
 
     setMainData: function(mainData) {
-        var me = this,
+        let me = this,
         viewModel = me.getViewModel();
 
         viewModel.setData(mainData);
@@ -342,7 +350,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     setDetailData: function(detailData, index) {
         index = index || 0;
 
-        var me = this,
+        let me = this,
         viewModel = me.getViewModel(),
         viewData = viewModel.getData(),
         detailGrids = me.query('detailGridField'),
@@ -354,12 +362,12 @@ Ext.define('saas.view.core.form.FormPanel', {
         store.removeAll();
         if (detailData.length > 0) {
 
-            for(var j = 0; j < detailData.length; j++) {
-                var d = detailData[j];
-                var o = {};
+            for(let j = 0; j < detailData.length; j++) {
+                let d = detailData[j];
+                let o = {};
                 o[detnoColumn] = j + 1;
-                var r = store.add(o)[0];
-                for(var k in d) {
+                let r = store.add(o)[0];
+                for(let k in d) {
                     r.set(k, d[k]);
                 }
             }
@@ -369,7 +377,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     initFormData: function(data) {
-        var me = this;
+        let me = this;
         me.setFormData(data);
         me.clearDirty();
     },
@@ -378,12 +386,12 @@ Ext.define('saas.view.core.form.FormPanel', {
      * 设置需要绑定的字段
      */
     setBindFields: function (items) {
-        var me = this,
+        let me = this,
             viewModel = me.getViewModel(),
             bindFields = ['id', me._codeField, me._statusCodeField, me._statusField];
 
         Ext.Array.each(items, function (item) {
-            var xtype = item.xtype,
+            let xtype = item.xtype,
             bind = item.bind,
             name = item.name,
             ignore = item.ignore,
@@ -399,6 +407,7 @@ Ext.define('saas.view.core.form.FormPanel', {
 
 
             if (xtype == 'detailGridField') {
+                item.defaultColumns = item.columns;
                 return;
             }
 
@@ -434,9 +443,9 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     clearDirty: function() {
-        var me = this;
-        var detailGrids = me.query('detailGridField');
-        var fields = me.getForm().getFields().items;
+        let me = this;
+        let detailGrids = me.query('detailGridField');
+        let fields = me.getForm().getFields().items;
         
         Ext.Array.each(fields, function(f) {
             f.resetOriginalValue ? f.resetOriginalValue() : '';
@@ -447,11 +456,11 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     setEditable: function(able) {
-        var me = this,
+        let me = this,
         viewModel = me.getViewModel(),
         items = me.getForm().getFields().items;
 
-        var detailGrids = me.query('detailGridField');
+        let detailGrids = me.query('detailGridField');
 
         Ext.Array.each(detailGrids, function(g) {
 
@@ -467,16 +476,16 @@ Ext.define('saas.view.core.form.FormPanel', {
 
     //overriders
     isValid: function() {
-        var me = this;
-        var viewModel = me.getViewModel();
-        var formItems = me.formItems || [];
-        var valid = !Ext.Array.findBy(formItems, function(f) {
+        let me = this;
+        let viewModel = me.getViewModel();
+        let formItems = me.formItems || [];
+        let valid = !Ext.Array.findBy(formItems, function(f) {
             return !f.isValid();
         });
-        var detailGrids = me.query('detailGridField');
+        let detailGrids = me.query('detailGridField');
 
-        for(var i = 0; i < detailGrids.length; i++) {
-            var g = detailGrids[i];
+        for(let i = 0; i < detailGrids.length; i++) {
+            let g = detailGrids[i];
             if(!g.isValid()) {
                 valid = false;
                 break;
@@ -487,13 +496,13 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     isDirty: function () {
-        var me = this,
+        let me = this,
         formItems = me.formItems || [],
         detailGrids = me.query('detailGridField'),
         dirty = false;
 
-        for(var i = 0; i < detailGrids.length; i++) {
-            var grid = detailGrids[i];
+        for(let i = 0; i < detailGrids.length; i++) {
+            let grid = detailGrids[i];
             if(grid.isDirty()) {
                 dirty = true;
                 break;
@@ -510,7 +519,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     getSaveData: function() {
-        var me = this,
+        let me = this,
         viewModel = me.getViewModel(),
         allData = viewModel.getData(),
         bindFields = allData.base.bindFields,
@@ -519,22 +528,22 @@ Ext.define('saas.view.core.form.FormPanel', {
         detailGrids = me.query('detailGridField');
 
         Ext.Array.each(bindFields, function(field) {
-            var v = allData[field];
+            let v = allData[field];
             if(Ext.isDate(v)) {
                 v = Ext.Date.format(v, 'Y-m-d H:i:s');
             }
             formData[field] = v;
         });
 
-        var dirtyData = {
+        let dirtyData = {
             main: formData,
         };
 
-        for (var i = 0; i < detailCount; i++) {
-            var g = detailGrids[i];
-            var gridDirtyData = g.getSaveData();
-            var modelDetail = allData['detail' + i];
-            var detailBindFields = modelDetail.detailBindFields;
+        for (let i = 0; i < detailCount; i++) {
+            let g = detailGrids[i];
+            let gridDirtyData = g.getSaveData();
+            let modelDetail = allData['detail' + i];
+            let detailBindFields = modelDetail.detailBindFields;
 
             Ext.Array.each(gridDirtyData, function(d) {
                 for(k in d) {
@@ -552,7 +561,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     getDirtyData: function() {
-        var me = this,
+        let me = this,
         formF = me.getForm(),
         viewModel = me.getViewModel(),
         allData = viewModel.getData(),
@@ -562,8 +571,8 @@ Ext.define('saas.view.core.form.FormPanel', {
         detailGrids = me.query('detailGridField');
 
         Ext.Array.each(bindFields, function(field) {
-            var v = allData[field];
-            var f = formF.findField(field);
+            let v = allData[field];
+            let f = formF.findField(field);
             if(Ext.isDate(v)) {
                 v = Ext.Date.format(v, 'Y-m-d H:i:s');
             }
@@ -572,15 +581,15 @@ Ext.define('saas.view.core.form.FormPanel', {
             }
         });
 
-        var dirtyData = {
+        let dirtyData = {
             main: formData,
         };
 
-        for (var i = 0; i < detailCount; i++) {
-            var g = detailGrids[i];
-            var gridDirtyData = g.getDirtyData();
-            var modelDetail = allData['detail' + i];
-            var detailBindFields = modelDetail.detailBindFields;
+        for (let i = 0; i < detailCount; i++) {
+            let g = detailGrids[i];
+            let gridDirtyData = g.getDirtyData();
+            let modelDetail = allData['detail' + i];
+            let detailBindFields = modelDetail.detailBindFields;
 
             Ext.Array.each(gridDirtyData, function(d) {
                 for(k in d) {
@@ -614,7 +623,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     promiseCloseTab: function() {
-        var me = this,
+        let me = this,
         controller = me.getController();
 
         if(me.isDirty()) {
@@ -632,5 +641,9 @@ Ext.define('saas.view.core.form.FormPanel', {
                 return resolve(true);
             });
         }
+    },
+
+    refreshViewConfig: function() {
+        this.getController().refresh();
     }
 });

+ 80 - 20
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -130,9 +130,8 @@ Ext.define('saas.view.core.form.FormPanelController', {
                             saas.util.BaseUtil.showSuccessToast('删除成功');
                         }
                     })
-                    .catch(function(res) {
-                        console.error(res);
-                        saas.util.BaseUtil.showErrorToast('删除失败: ' + res.message);
+                    .catch(function(e) {
+                        saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                     });
                 }
             });
@@ -211,11 +210,10 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 form.fireEvent('aftersave', true, form, localJson);
             }
         })
-        .catch(function(res) {
+        .catch(function(e) {
             form.setLoading(false);
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
-            form.fireEvent('aftersave', false, form, res);
+            saas.util.BaseUtil.showErrorToast('保存失败: ' + e.message);
+            form.fireEvent('aftersave', false, form);
         });
     },
 
@@ -304,23 +302,23 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 form.fireEvent('afteraudit', true, form, localJson);
             }
         })
-        .catch(function(res) {
+        .catch(function(e) {
             form.setLoading(false);
-            console.error(res);
-            if(res.data) {
-                var id = localJson.data.id;
-                var code = localJson.data.code;
+            // console.error(e);
+            // if(res.data) {
+            //     var id = localJson.data.id;
+            //     var code = localJson.data.code;
                 
-                form.initId = id;
+            //     form.initId = id;
 
-                var newId = form.xtype + '-' + id;
-                var newTitle = form._title + '(' + code + ')';
+            //     var newId = form.xtype + '-' + id;
+            //     var newTitle = form._title + '(' + code + ')';
 
-                saas.util.BaseUtil.refreshTabTitle(newId, newTitle);
-                saas.util.FormUtil.loadData(form);
-            }
-            saas.util.BaseUtil.showErrorToast('审核失败: ' + res.message);
-            form.fireEvent('afteraudit', false, form, res);
+            //     saas.util.BaseUtil.refreshTabTitle(newId, newTitle);
+            //     saas.util.FormUtil.loadData(form);
+            // }
+            saas.util.BaseUtil.showErrorToast('审核失败: ' + e.message);
+            form.fireEvent('afteraudit', false, form);
         });
     },
 
@@ -492,5 +490,67 @@ Ext.define('saas.view.core.form.FormPanelController', {
             console.error(res.message);
             saas.util.BaseUtil.showErrorToast('未通过权限验证:' + res.message);
         });
+    },
+
+    onSetting: function() {
+        var me = this,
+        form = me.getView(),
+        viewName = form.viewName,
+        configItems = form.configItems,
+        items = [];
+
+        Ext.Array.sort(configItems, function(a, b) {
+            return a.index - b.index;
+        });
+
+        for(let i = 0; i < configItems.length; i++) {
+            let item = configItems[i];
+            let formItem = form.query('[name=' + item.name + ']')[0];
+            let xtypes = formItem.getXTypes().split('/');
+            item.xtypes = xtypes;
+            if(!item.initHidden) {
+                items.push(Object.assign({}, item));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, 'main');
+    },
+
+    onColSetting: function(ct, col, e, t, eoPts) {
+        let me = this,
+        form = me.getView(),
+        viewName = form.viewName,
+        grid = ct.grid.ownerGrid,
+        columns = grid.defaultColumns,
+        items = [];
+
+        for(let i = 0; i < columns.length; i++) {
+            let col = columns[i];
+            if(!col.initHidden) {
+                items.push(Object.assign({}, col));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, grid.gname);
+    },
+
+    openSettingWindow: function(viewName, items, settype) {
+        var panel = saas.util.BaseUtil.getCurrentTab(),
+        box = panel.getBox(),
+        refs = panel.getReferences() || {},
+        win = refs.settingwin;
+
+        title = settype == 'main' ? '界面设置' : '列设置';
+
+        if(!win) {
+            win = panel.add({
+                title: title,
+                xtype: 'settingwin',
+                viewName: viewName,
+                fieldItems: Ext.Array.clone(items),
+                settype: settype,
+            });
+        }
+        win.show();
     }
 });

+ 488 - 0
frontend/saas-web/app/view/core/form/SettingWin.js

@@ -0,0 +1,488 @@
+Ext.define('saas.view.core.form.SettingWin', {
+    extend: 'Ext.window.Window',
+    xtype: 'settingwin',
+
+    requires: [
+        'Ext.grid.plugin.DragDrop'
+    ],
+
+    controller: 'settingwin',
+
+    cls: 'x-window-dbfind x-setting-win',
+    modal: true,
+    height: 400,
+    width: 714,
+    title: '界面设置',
+    scrollable: true,
+    bodyPadding: 10,
+    constrain: true,
+    closable: true,
+    layout: 'fit',
+    reference: 'settingwin',
+
+    etc: {
+        columns: [{
+            text: '序号',
+            dataIndex: 'index',
+            align: 'center',
+            width: 80
+        }, {
+            text: '标识名称',
+            dataIndex: 'name',
+            hidden: true
+        }, {
+            text: '字段名称',
+            dataIndex: 'text',
+            width: 150,
+            renderer: function(v, m, r) {
+                if(!r.get('allowBlank')) {
+                    m.tdCls = 'x-cell-required'; 
+                }
+                if(r.get('type') == 'group') {
+                    m.tdCls = 'x-cell-group'; 
+                }
+                return v;
+            }
+        }, {
+            text: '自定义显示名称',
+            dataIndex: 'alias',
+            width: 150,
+            editor: {
+                xtype: 'textfield',
+            }
+        }, {
+            text: '类型',
+            dataIndex: 'type',
+            editor: {
+                xtype: 'combo',
+                typeAhead: true,
+                triggerAction: 'all',
+                readOnly: true,
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['name', 'value'],
+                    data: [
+                        { value: 'group', name: '组别' },
+                        { value: 'number', name: '数字' },
+                        { value: 'date', name: '日期' },
+                        { value: 'dbfind', name: '放大镜' },
+                        { value: 'combo', name: '下拉' },
+                        { value: 'radio', name: '单选' },
+                        { value: 'check', name: '勾选' },
+                        { value: 'string', name: '文本' },
+                        { value: 'grid', name: '明细表' }
+                    ]
+                })
+            },
+            renderer: function(v, m, r) {
+                return Ext.Array.findBy([
+                    ['group', '组别'],
+                    ['number', '数字'],
+                    ['date', '日期'],
+                    ['dbfind', '放大镜'],
+                    ['combo', '下拉'],
+                    ['radio', '单选'],
+                    ['check', '勾选'],
+                    ['string', '文本',],
+                    ['grid', '明细表']
+                ], function(x) {
+                    return x[0] == v;
+                })[1];
+            }
+        }, {
+            text: '显示',
+            dataIndex: 'enable',
+            xtype: 'actioncolumn',
+            menuDisabled: true,
+            // tooltip: '显示',
+            align: 'center',
+            handler: 'onToggleEnable',
+            getClass: 'getEnableCls',
+            isActionDisabled: 'isEnableDisabled'
+        }, {
+            text: '宽度',
+            dataIndex: 'width',
+            align: 'end',
+            hidden: true,
+            editor: {
+                xtype: 'combo',
+                editable: false,
+                store: [
+                    [1,1],
+                    [2,2],
+                    [3,3],
+                    [4,4]
+                ]
+            }
+        }, {
+            text: '宽度',
+            dataIndex: 'width',
+            align: 'end',
+            hidden: true,
+            editor: {
+                xtype: 'numberfield',
+                decimalPrecision: 0
+            }
+        }],
+    },
+
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            items: [{
+                xtype: 'grid',
+                sortableColumns: false,
+                enableColumnHide: false,
+                plugins: [{
+                    ptype: 'cellediting',
+                    clicksToEdit: 1,
+                    listeners: {
+                        beforeedit: 'onBeforeEdit',
+                        edit: function(editor, context, eOpts) {
+                            context.column.fireEvent('edit', context.value, me, context.column, editor, context, eOpts);
+                        }
+                    }
+                }, {
+                    ptype: 'menuclipboard'
+                }],
+                viewConfig: {
+                    plugins: {
+                        gridviewdragdrop: {
+                            containerScroll: true,
+                            dragGroup: 'dd-grid-group',
+                            dropGroup: 'dd-grid-group',
+                            dragText: '移动到此位置'
+                        }
+                    },
+        
+                    listeners: {
+                        drop: 'onDrop'
+                    }
+                },
+                store: Ext.create('Ext.data.Store', {
+                    // 序号、字段名、名称、必填、别名、类型、启用、宽度
+                    fields: [
+                        { name: 'index', type: 'int' },
+                        { name: 'name', type: 'string' },
+                        { name: 'allowBlank', type: 'boolean' },
+                        { name: 'text', type: 'string' },
+                        { name: 'alias', type: 'string' },
+                        { name: 'type', type: 'string' },
+                        { name: 'enable', type: 'boolean' },
+                        { name: 'width', type: 'float'}
+                    ],
+                    data: [],
+                }),
+                columns: me.getColumns(),
+                bbar: [{
+                    xtype: 'tbtext',
+                    style: {
+                        color: '#4A4A4A'
+                    },
+                    text: '* 拖动行以调整字段顺序',
+                }, '->', {
+                    text: '重置',
+                    handler: 'onReset'
+                }, {
+                    text: '保存',
+                    handler: 'onSave'
+                }],
+                listeners: {
+                    afterrender: function(grid) {
+                        me.initData(grid);
+                    }
+                },
+            }]
+        });
+
+        me.callParent(arguments);
+    },
+
+    initData: function() {
+        var me = this;
+        me.setStoreData();
+    },
+
+    setStoreData: function() {
+        var me = this,
+        grid = me.down('grid'),
+        store = grid.store,
+        data = me.getStoreData();
+        
+        if(store.getCount() == data.length) {
+            for(let j = 0; j < data.length; j++) {
+                let d = data[j];
+                let r = store.getAt(j);
+                for(let k in d) {
+                    r.set(k, d[k]);
+                }
+                // r.commit();
+            }
+        }else {
+            store.loadData(data);
+        }
+        
+        store.each(function(r, idx) {
+            let type = r.get('type');
+            r.set('index', idx + 1);
+            if(type == 'group') {
+                let flag = store.getAt(idx + 1) && store.getAt(idx + 1).get('type') == 'group';
+
+                if(flag)  {
+                    r.set('enable', !flag);
+                }
+                r.set('disabled', flag);
+            }
+        });
+    },
+
+    getStoreData: function() {
+        var me = this,
+        items = me.fieldItems || [],
+        settype = me.settype,
+        storeData = [];
+
+        storeData = items.map(function(item, idx) {
+            return {
+                index: idx + 1,
+                name: me.getFieldName(item, settype),
+                allowBlank: item.allowBlank,
+                text: me.getFieldText(item, settype),
+                alias: me.getFieldAlias(item, settype),
+                type: me.getFieldType(item, settype),
+                enable: !item.hidden,
+                width: me.getFieldWidth(item, settype)
+            }
+        });
+
+        return storeData;
+    },
+
+    getColumns: function(settype) {
+        var me = this,
+        etc = me.etc,
+        settype = me.settype,
+        columns = etc.columns;
+        if(settype == 'main') {
+            columns[6].hidden = false;
+            columns[7].hidden = true;
+        }else {
+            columns[6].hidden = true;
+            columns[7].hidden = false;
+        }
+        return columns;
+    },
+
+    getFieldName: function(item, settype) {
+        let name = '';
+        if(settype == 'main') {
+            name = item.name;
+        }else {
+            name = item.dataIndex;
+        }
+        return name;
+    },
+
+    getFieldText: function(item, settype) {
+        let text = '';
+        if(settype == 'main') {
+            text = item._init_fieldLabel || item.fieldLabel;
+        }else {
+            text = item._init_text || item.text;
+        }
+        return text;
+    },
+
+    getFieldAlias: function(item, settype) {
+        let text = '';
+        if(settype == 'main') {
+            if(item._init_fieldLabel) {
+                text = item.fieldLabel;
+            }else if(item._init_html) {
+                text = item.html;
+            }
+        }else {
+            if(item._init_text) {
+                text = item.text;
+            }
+        }
+        return text;
+    },
+
+    getFieldType: function(field, settype) {
+        let me = this,
+        type = '';
+        if(settype == 'main') {
+            let xtypes = field.xtypes;
+            if (me.isContainsAny(xtypes, ['separatefield'])) {
+                type = 'group';
+            }else if (me.isContainsAny(xtypes, ['numberfield'])) {
+                type = 'number';
+            } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
+                type = 'date';
+            } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+                type = 'dbfind';
+            } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo'])) {
+                type = 'combo';
+            } else if(me.isContainsAny(xtypes, ['radiofield', 'radio'])) {
+                type = 'radio'
+            } else if(me.isContainsAny(xtypes, ['checkboxfield', 'checkbox'])) {
+                type = 'check'
+            } else if(me.isContainsAny(xtypes, ['detailGridField', 'grid'])) {
+                type = 'grid'
+            } else {
+                type = 'string';
+            }
+        }else {
+            let xtypes = [field.xtype];
+            if (me.isContainsAny(xtypes, ['numbercolumn'])) {
+                type = 'number';
+            } else if (me.isContainsAny(xtypes, ['datecolumn'])) {
+                type = 'date';
+            } else if (me.isContainsAny(xtypes, ['checkcolumn'])) {
+                type = 'check';
+            } else {
+                type = 'string';
+            }
+        }
+        return type;
+    },
+
+    getFieldWidth: function(item, settype) {
+        let width = 0;
+        if(settype == 'main') {
+            width = item.columnWidth * 4
+        }else {
+            width = item.width
+        }
+
+        return width;
+    },
+
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
+            var a2 = arr2[i];
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    getDirtyData: function() {
+        var me = this,
+        grid = me.down('grid'),
+        store = grid.store,
+        dirtyData = [];
+
+        store.each(function(r) {
+            if(r.isDirty()) {
+                dirtyData.push(r);
+            }
+        });
+
+        return dirtyData;
+    },
+
+    getCusConfig: function() {
+        var me = this,
+        settype = me.settype,
+        items = me.fieldItems,
+        grid = me.down('grid'),
+        store = grid.store,
+        storeData = store.getData().items,
+        cusConfig = [];
+
+        cusConfig = storeData.map(function(d) {
+            let modified = d.modified || {},
+            nameField = settype == 'main' ? 'name' : 'dataIndex',
+            textField = settype == 'main' ? (d.get('type') == 'group' ? 'html' : 'fieldLabel') : 'text',
+            name = d.get('name');
+
+            // 强行保存序号
+            modified.index = d.get('index');
+
+            let mks = Ext.Object.getAllKeys(modified);
+
+            let item = Ext.Array.findBy(items, function(item) {
+                return item[nameField] == name;
+            });
+
+            let obj = {};
+            obj[nameField] = name;
+
+            let iks = Ext.Object.getAllKeys(item);
+
+            if(mks.length == 0 && !me.isModified(iks)) {
+                // 目前这里是永远不会进来了
+                obj = null;
+            }else {
+                mks.map(function(k) {
+                    let v =  d.get(k);
+
+                    if(k == 'enable') {
+                        k = 'hidden';
+                        v = !v;
+                    }else if(k == 'alias') {
+                        k = textField;
+                    }else if(k == 'width') {
+                        if(settype == 'main') {
+                            k = 'columnWidth';
+                            v = v / 4;
+                        }
+                    }
+
+                    obj[k] = v;
+                });
+
+                iks.map(function(k) {
+                    if(k.startsWith('_init_')) {
+                        k = k.replace('_init_', '');
+                        let v =  d.get(k);
+
+                        if(k == textField) {
+                            v = d.get('alias');
+                        }else if(k == 'hidden') {
+                            v = !d.get('enable');
+                        }else if(k == 'columnWidth') {
+                            v = d.get('width') / 4;
+                        }
+                        obj[k] = v;
+                    }
+                });
+            }
+
+            // 去除空别名
+            if(obj.hasOwnProperty(textField) && obj[textField].trim() == '') {
+                delete obj[textField];
+            }
+
+            return obj;
+        });
+
+        cusConfig = Ext.Array.filter(cusConfig, function(c) {
+            return !!c;
+        });
+
+        return cusConfig;
+    },
+
+    isModified: function(keys) {
+        let flag = false;
+        
+        for(let i = 0; i < keys.length; i++) {
+            let k = keys[i];
+            if(k.startsWith('_init_')) {
+                flag = true;
+                break;
+            }
+        }
+
+        return flag;
+    }
+});

+ 29 - 0
frontend/saas-web/app/view/core/form/SettingWin.scss

@@ -0,0 +1,29 @@
+.x-setting-win {
+    padding: 0 !important;
+
+    .x-window-body {
+        padding-bottom: 0 !important;
+    }
+
+    .x-docked-bottom {
+        padding: 6px 0px 6px 10px;
+    }
+
+    .x-cell-group {
+        font-weight: bold;
+    }
+
+    .x-keyboard-mode .x-grid-item-focused,
+    .x-cell-required {
+        &>div {
+            &:before {
+                content: "*" !important;
+                color: red;
+                font-size: 24px;
+                position: absolute;
+                left: 0;
+                top: 10px !important;
+            }
+        }
+    }
+}

+ 139 - 0
frontend/saas-web/app/view/core/form/SettingWinController.js

@@ -0,0 +1,139 @@
+Ext.define('saas.view.core.form.SettingWinController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.settingwin',
+
+    getEnableCls: function(v, m, r) {
+        let checked = r.data.enable;
+        return 'x-grid-checkcolumn' + (checked ? ' x-grid-checkcolumn-checked' : '');
+    },
+
+    isEnableDisabled: function(view, rowIdx, colIdx, item, record) {
+        return !record.data.allowBlank;
+    },
+
+    onBeforeEdit: function(editor, context, eOpts) {
+        let record = context.record,
+        column = context.column,
+        disabled = record.get('disabled'),
+        type = record.get('type'),
+        flag = true;
+
+        if(
+            (disabled && column.dataIndex == 'enable') ||
+            ['grid'].indexOf(type) != -1 ||
+            (['group'].indexOf(type) != -1 && column.dataIndex == 'width')
+        ) {
+            flag = false;
+        }
+
+        return flag;
+    },
+
+    onToggleEnable: function(grid, rowIndex, colIndex, actionItem, event, record, row) {
+        if(this.onBeforeEdit(null, {record: record, column: grid.up('grid').columns[colIndex]})) {
+            let checked = record.get('enable');
+            record.set('enable', !checked);
+        }
+    },
+
+    onDrop: function() {
+        var me = this,
+        win = me.getView(),
+        grid = win.down('grid'),
+        store = grid.getStore();
+
+        store.each(function(r, idx) {
+            let type = r.get('type');
+            r.set('index', idx + 1);
+            if(type == 'group') {
+                let flag = store.getAt(idx + 1) && store.getAt(idx + 1).get('type') == 'group';
+
+                if(flag)  {
+                    r.set('enable', !flag);
+                }
+                r.set('disabled', flag);
+            }
+        });
+    },
+
+    onAfterrender: function() {
+        var me = this,
+        win = me.getView();
+        
+        win.initData();
+    },
+
+    onReset: function() {
+        var me = this,
+        win = me.getView(),
+        grid = win.down('grid');
+
+        // saas.util.BaseUtil.showConfirm('警告', '即将清空所有自定义配置,是否继续?<br/>'+'<span style="color: red;font-size: 12px;">(*保存后生效)</span>')
+        // .then(function(bid) {
+        //     if(bid == 'yes') {
+                win.fieldItems = me.resetItems();
+                win.setStoreData();
+        //     }
+        // })
+    },
+
+    resetItems: function() {
+        var me = this,
+        win = me.getView(),
+        items = win.fieldItems,
+        data = [];
+
+        items.map(function(item) {
+            let keys = Ext.Object.getAllKeys(item);
+            let o = Object.assign({}, item);
+            keys.map(function(k) {
+                if(k.startsWith('_init_')) {
+                    let nk = k.replace('_init_', '');
+                    o[nk] = item[k];
+                    delete o[k];
+                }
+            });
+            data.push(o);
+        });
+
+        Ext.Array.sort(data, function(a, b) {
+            return a.index - b.index;
+        });
+
+        return data;
+    },
+
+    onSave: function() {
+        var me = this,
+        win = me.getView(),
+        viewName = win.viewName,
+        settype = win.settype,
+        modifiedCfg = win.getCusConfig();
+
+        saas.util.ViewUtil.saveViewConfig(viewName, settype, modifiedCfg)
+        .then(function(res) {
+            if(res.success) {
+                saas.util.BaseUtil.showSuccessToast('保存成功');
+                return true;
+            }else {
+                saas.util.BaseUtil.showErrorToast('保存失败:' + res.message);
+                return false;
+            }
+        }).then(function(success) {
+            var c = success && saas.util.BaseUtil.getCurrentTab().down('container');
+            if(typeof c.refreshViewConfig === 'function') {
+                c.refreshViewConfig();
+            }
+        })
+        .then(function() {
+            win.close();
+        })
+        .catch(function(res) {
+            saas.util.BaseUtil.showErrorToast('保存失败:' + res.message);
+        });
+    },
+
+    onAliasEdit: function(value, thview, column, editor, context, eOpts) {
+        var flag = false
+    }
+});

+ 18 - 4
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -135,7 +135,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         showCount = me.showCount,
 
         indexColumn = {
-            text : "序号", 
+            // text : "序号", 
+            // text: '<div class="x-sa sa-setting" style="cursor: pointer;" title="列设置"></div>',
+            bind: {
+                text: "{isAdmin ? ('<div class=\"x-sa sa-setting\" style=\"cursor: pointer;\" title=\"列设置\"></div>') : '序号'}"
+            },
             dataIndex : detnoField, 
             width : 60, 
             xtype : "numbercolumn",
@@ -151,6 +155,17 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                     '<div style="line-height: 19px; flex: 1; color: #FF002B; cursor: pointer; margin-left: 2px;" class="x-row-delete fa fa-minus" title="删除行"></div>'+
                 '</div>';
             },
+            listeners: {
+                headerclick: function() {
+                    let form = this.up('core-form-formpanel'),
+                    controller = form.getController(),
+                    text = this.text;
+
+                    if(text != '序号') {
+                        controller.onColSetting(arguments[0]);
+                    }
+                }
+            }
         };
 
         if(showCount) {
@@ -287,16 +302,15 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                         //解析参数
                         saas.util.BaseUtil.showSuccessToast('删除成功');
                     })
-                    .catch(function() {
+                    .catch(function(e) {
                         me.fireEvent('validChange');
                         //失败
-                        saas.util.BaseUtil.showErrorToast('删除失败');
+                        saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                     });
                 }else {
                     throw new Error();
                 }
             })
-            .catch()
         }else {
             store.remove(selectedRecord);
             me.fireEvent('validChange');

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

@@ -0,0 +1,15 @@
+Ext.define('saas.view.core.form.field.SeparateField', {
+    extend: 'Ext.container.Container',
+    xtype: 'separatefield',
+    userCls: 'x-field-separator',
+    height: 36,
+    columnWidth: 1,
+    ignore: true,
+    // initHidden: true,
+    isValid: function() {
+        return true;
+    },
+    isDirty: function() {
+        return false;
+    }
+});

+ 74 - 37
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -60,11 +60,17 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             me.idField = '_id';
         }
 
+        // me.initColumns(null, 'MAIN').then(function(columns) {
+        //     Ext.apply(me, {
+        //         columns: columns,
+        //         mode: 'MAIN'
+        //     });
+        // });
+
         Ext.apply(me, {
             viewConfig: {
                 deferEmptyText: false,
             },
-            columns: me.initColumns(),
             store: Ext.create('Ext.data.Store', {
                 fields: me.getFields(),
                 autoLoad: true,
@@ -134,11 +140,25 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         store.loadData(datas, false);
 
                         if(mode=="MAIN"){
-                            me.reconfigure(store, me.initColumns(me.baseColumn));
-                            me.applyScrollable(true)
+                            me.initColumns(me.baseColumn, mode).then(function(columns) {
+                                me.reconfigure(store, columns.concat([{
+                                    dataIndex: '',
+                                    flex: 1,
+                                    initHidden: true,
+                                    allowBlank: true
+                                }]));
+                                me.applyScrollable(true)
+                            });
                         }else{
-                            me.reconfigure(store, me.initColumns(me.relativeColumn));
-                            me.applyScrollable(true)
+                            me.initColumns(me.relativeColumn, mode).then(function(columns) {
+                                me.reconfigure(store, columns.concat([{
+                                    dataIndex: '',
+                                    flex: 1,
+                                    initHidden: true,
+                                    allowBlank: true
+                                }]));
+                                me.applyScrollable(true)
+                            });
                         }
                     }
                 }
@@ -234,7 +254,15 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 cls: 'core-query-pagingtoolbar',
                 dock: 'bottom',
                 displayInfo: true,
-                store: me.store
+                store: me.store,
+                items: [{
+                    iconCls: 'x-sa sa-setting',
+                    text: '列设置',
+                    handler: 'onColSetting',
+                    bind: {
+                        hidden: '{!isAdmin}'
+                    }
+                }]
             }]
         });
         me.callParent(arguments);
@@ -262,39 +290,48 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             }
         },
     },
-    initColumns: function(columns) {
+    initColumns: function(columns, mode) {
         var me = this,
+        queryPanel = me.up('core-query-querypanel'),
+        viewName = queryPanel.viewName,
         columns = columns || me.columns;
 
-        Ext.Array.each(columns, function(c) {
-            if(c.dataIndex == me.codeField) {
-                Ext.applyIf(c, {
-                    tdCls: 'x-querygrid-code-column'
-                });
-            }
-            if(c.xtype == 'datecolumn') {
-                Ext.applyIf(c, {
-                    format:'Y-m-d',
-                    //只导出年月日
-                    // exportStyle: {
-                    //     format: 'Medium Date'
-                    // },
-                    copyRender: function(value) {
-                        return Ext.Date.format(new Date(value), 'Y-m-d');
-                    },
-                    exportRenderer: function (value) {
-                        return Ext.Date.format(new Date(value), 'Y-m-d');
-                    }
-                })
-            }
-            if(c.xtype == 'numbercolumn') {
-                Ext.applyIf(c, {
-                    align: 'end'
-                });
-            }
-        });
+        return saas.util.ViewUtil.applyColumns(viewName + '-' + mode, columns)
+        .then(function(columns) {
+            queryPanel.defaultColumns = me.defaultColumns = columns;
+            Ext.Array.each(columns, function(c) {
+                if(c.dataIndex == me.codeField) {
+                    c.allowBlank = false;
+                    c.tdCls = c.tdCls ? (c.tdCls + ' x-querygrid-code-column') : 'x-querygrid-code-column'
+                    // Ext.apply(c, {
+                    //     allowBlank: false,
+                    //     tdCls: 'x-querygrid-code-column'
+                    // });
+                }
+                if(c.xtype == 'datecolumn') {
+                    Ext.applyIf(c, {
+                        format:'Y-m-d',
+                        //只导出年月日
+                        // exportStyle: {
+                        //     format: 'Medium Date'
+                        // },
+                        copyRender: function(value) {
+                            return Ext.Date.format(new Date(value), 'Y-m-d');
+                        },
+                        exportRenderer: function (value) {
+                            return Ext.Date.format(new Date(value), 'Y-m-d');
+                        }
+                    })
+                }
+                if(c.xtype == 'numbercolumn') {
+                    Ext.applyIf(c, {
+                        align: 'end'
+                    });
+                }
+            });
 
-        return columns;
+            return columns;
+        });
     },
     getFields: function() {
         var me = this;
@@ -345,8 +382,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 });
             }
         })
-        .catch(function(res) {
-            saas.util.BaseUtil.showErrorToast('导出失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('导出失败: ' + e.message);
         });
     },
     onCloseOrder:function(me){

+ 4 - 7
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -132,13 +132,6 @@ Ext.define('saas.view.core.query.QueryPanel', {
         
         var columns = queryGridConfig.baseColumn || [];
 
-        if(columns[columns.length - 1].flex != 1) {
-            columns.push({
-                flex: 1,
-                allowBlank: true
-            });
-        }
-
         me.queryGridConfig['columns']=columns;
         Ext.apply(queryGrid,me.queryGridConfig);
     },
@@ -326,5 +319,9 @@ Ext.define('saas.view.core.query.QueryPanel', {
         queryGrid = me.down('core-query-querygridpanel');
 
         queryGrid.store.reload();
+    },
+
+    refreshViewConfig: function() {
+        this.refresh();
     }
 });

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

@@ -44,5 +44,43 @@ Ext.define('saas.view.core.query.QueryPanelController', {
     },
     onCloseClick:function(btn){
         this.queryWin = Ext.destroy(this.queryWin);
+    },
+
+    onColSetting: function() {
+        var me = this,
+        panel = me.getView(),
+        mode = panel.getQueryMode(),
+        viewName = panel.viewName,
+        columns = panel.defaultColumns,
+        items = [];
+
+        for(let i = 0; i < columns.length; i++) {
+            let col = columns[i];
+            if(!col.initHidden) {
+                items.push(Object.assign({}, col));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, 'columns', mode);
+    },
+
+    openSettingWindow: function(viewName, items, settype, mode) {
+        var panel = saas.util.BaseUtil.getCurrentTab(),
+        box = panel.getBox(),
+        refs = panel.getReferences() || {},
+        win = refs.settingwin;
+
+        title = '列设置';
+
+        if(!win) {
+            win = panel.add({
+                title: title,
+                xtype: 'settingwin',
+                viewName: viewName + '-' + mode,
+                fieldItems: Ext.Array.clone(items),
+                settype: settype,
+            });
+        }
+        win.show();
     }
 });

+ 157 - 114
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -37,112 +37,123 @@ Ext.define('saas.view.core.report.ReportPanel', {
         var printAble = me.printAble;
         var exportAble = me.exportAble;
         var store = me.initStore();
-        columnWidth: 0.25,
-            Ext.apply(me, {
-                items: [{
-                    xtype: 'form',
-                    width: '100%',
-                    layout: 'column',
-                    defaults: {
-                        margin: '0 5 5 0',
-                        labelAlign: 'right',
-                        labelWidth: 90,
-                        columnWidth: 0.25,
-                    },
-                    items: me.initSearchItems().concat([{
-                        xtype: 'container',
-                        columnWidth: me.QueryWidth || 0.5,
-                        items: [{
-                            xtype: 'button',
-                            text: '查询',
-                            handler: 'onQuery',
-                            formBind: true
-                        }, {
-                            xtype: 'button',
-                            text: '打印',
-                            hidden: !printAble,
-                            style: {
-                                float: 'right'
-                            },
-                            handler: 'exportTo',
-                            cfg: {
-                                type: 'html',
-                                includeGroups: true,
-                                includeSummary: true,
-                                isPrint: true
-                            }
-                        }, {
-                            xtype: 'button',
-                            style: {
-                                float: 'right'
+        Ext.apply(me, {
+            items: [{
+                xtype: 'form',
+                width: '100%',
+                layout: 'column',
+                defaults: {
+                    margin: '0 5 5 0',
+                    labelAlign: 'right',
+                    labelWidth: 90,
+                    columnWidth: 0.25,
+                },
+                items: me.initSearchItems().concat([{
+                    xtype: 'container',
+                    columnWidth: me.QueryWidth || 0.5,
+                    items: [{
+                        xtype: 'button',
+                        text: '查询',
+                        handler: 'onQuery',
+                        formBind: true
+                    }, {
+                        xtype: 'button',
+                        text: '打印',
+                        hidden: !printAble,
+                        style: {
+                            float: 'right'
+                        },
+                        handler: 'exportTo',
+                        cfg: {
+                            type: 'html',
+                            includeGroups: true,
+                            includeSummary: true,
+                            isPrint: true
+                        }
+                    }, {
+                        xtype: 'button',
+                        style: {
+                            float: 'right'
+                        },
+                        text: '导出',
+                        hidden: !exportAble,
+                        menu: {
+                            defaults: {
+                                handler: 'exportTo'
                             },
-                            text: '导出',
-                            hidden: !exportAble,
-                            menu: {
-                                defaults: {
-                                    handler: 'exportTo'
-                                },
-                                items: [{
-                                    text: 'Excel xlsx',
-                                    cfg: {
-                                        type: 'excel',
-                                        ext: 'xlsx'
-                                    }
-                                }, {
-                                    text: 'Excel xlsx (包含分组合计)',
-                                    cfg: {
-                                        type: 'excel',
-                                        ext: 'xlsx',
-                                        includeGroups: true,
-                                        includeSummary: true
-                                    }
-                                }, {
-                                    text: 'CSV',
-                                    cfg: {
-                                        type: 'csv'
-                                    }
-                                }, {
-                                    text: 'CSV (包含分组合计)',
-                                    cfg: {
-                                        type: 'csv',
-                                        includeGroups: true,
-                                        includeSummary: true
-                                    }
-                                }]
-                            }
-                        }]
-                    }])
+                            items: [{
+                                text: 'Excel xlsx',
+                                cfg: {
+                                    type: 'excel',
+                                    ext: 'xlsx'
+                                }
+                            }, {
+                                text: 'Excel xlsx (包含分组合计)',
+                                cfg: {
+                                    type: 'excel',
+                                    ext: 'xlsx',
+                                    includeGroups: true,
+                                    includeSummary: true
+                                }
+                            }, {
+                                text: 'CSV',
+                                cfg: {
+                                    type: 'csv'
+                                }
+                            }, {
+                                text: 'CSV (包含分组合计)',
+                                cfg: {
+                                    type: 'csv',
+                                    includeGroups: true,
+                                    includeSummary: true
+                                }
+                            }]
+                        }
+                    }]
+                }])
+            }, {
+                xtype: 'grid',
+                width: '100%',
+                cls: 'x-report-grid',
+                flex: 1,
+                border: 0,
+                sortableColumns: false,
+                enableColumnHide: false,
+                rowLines: false,
+                plugins: [{
+                    ptype: 'gridexporter',
                 }, {
-                    xtype: 'grid',
-                    width: '100%',
-                    cls: 'x-report-grid',
-                    flex: 1,
-                    border: 0,
-                    sortableColumns: false,
-                    enableColumnHide: false,
-                    rowLines: false,
-                    plugins: [{
-                        ptype: 'gridexporter',
-                    }, {
-                        ptype: 'menuclipboard'
-                    }],
-                    features: me.initFeatures(),
+                    ptype: 'menuclipboard'
+                }],
+                features: me.initFeatures(),
+                columns: me.applyColumns(me.reportColumns),
+                store: store,
+                dockedItems: [me.allowPaging ? {
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
                     store: store,
-                    columns: me.initColumns(),
-                    dockedItems: [me.allowPaging ? {
-                        xtype: 'pagingtoolbar',
-                        dock: 'bottom',
-                        displayInfo: true,
-                        store: store
-                    } : null],
-
-                    calculateProperty: me.calculateProperty,
-                    rootProperty: me.rootProperty,
-                    totalProperty: me.totalProperty,
-                }]
-            });
+                    items: me.allowCust ? [{
+                        iconCls: 'x-sa sa-setting',
+                        text: '列设置',
+                        handler: 'onColSetting',
+                        bind: {
+                            hidden: '{!isAdmin}'
+                        }
+                    }] : null
+                } : null],
+
+                calculateProperty: me.calculateProperty,
+                rootProperty: me.rootProperty,
+                totalProperty: me.totalProperty,
+            }]
+        });
 
         me.callParent(arguments);
+
+        if(me.allowCust) {
+            me.refreshColumns();
+        }
     },
 
     listeners: {
@@ -159,6 +170,33 @@ Ext.define('saas.view.core.report.ReportPanel', {
         }
     },
 
+    refreshColumns: function () {
+        this.initColumns(Ext.Array.clone(this.reportColumns))
+    },
+
+    initColumns: function (columns) {
+        var me = this,
+            grid = me.items.items[1],
+            viewName = me.viewName;
+
+        Ext.Array.each(columns, function (c) {
+            if(c.summaryType) {
+                c.allowBlank = false
+            }
+        });
+
+        return saas.util.ViewUtil.applyColumns(viewName, columns)
+            .then(function (columns) {
+                grid.defaultColumns = me.defaultColumns = columns;
+                return columns;
+            })
+            .then(function (columns) {
+                grid.reconfigure(grid.store, me.applyColumns(columns));
+                grid.store.loadPage(1);
+                grid.applyScrollable(true);
+            });
+    },
+
     getListGrid: function () {
         var me = this,
             grid = me.items.items[1];
@@ -188,16 +226,17 @@ Ext.define('saas.view.core.report.ReportPanel', {
     },
 
     initStore: function () {
-        var me = this, cfg = {};
+        var me = this,
+            cfg = {};
         // if(me.groupField) {
         //     cfg.sorters = {
         //         property: me.groupField,
         //         direction: 'ASC'
         //     }
         // }
-        if(me.reportModel) {
+        if (me.reportModel) {
             cfg.model = me.reportModel;
-        }else {
+        } else {
             cfg.fields = me.getFields();
         }
         var store = Ext.create('Ext.data.Store', Ext.Object.merge({
@@ -226,7 +265,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
                             } else {
-                                saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
+                                saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson ? response.responseJson.message : '请求超时'));
                             }
                         }
                     }
@@ -236,7 +275,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 beforeload: function (store, op) {
                     var condition = me.getConditions(),
                         defaultCondition = me.defaultCondition,
-                        summarys = me.summarys;
+                        summarys = me.removeSummarys ? '' : JSON.stringify(me.summarys);
 
                     if (defaultCondition) {
                         condition.push({
@@ -250,7 +289,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         size: store.exportPageSize ? store.exportPageSize : store.pageSize,
                         mode: me.queryMode || 'DETAIL',
                         condition: JSON.stringify(condition),
-                        calculateFields: JSON.stringify(summarys)
+                        calculateFields: summarys
                     });
                     Ext.apply(store.proxy.extraParams, params);
 
@@ -276,10 +315,9 @@ Ext.define('saas.view.core.report.ReportPanel', {
         });
     },
 
-    initColumns: function () {
+    applyColumns: function (columns) {
         var me = this,
-            columns = me.reportColumns,
-            summarys = [];
+        summarys = [];
 
         Ext.Array.each(columns, function (c) {
             c.columns || Ext.applyIf(c, {
@@ -311,7 +349,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     //     var format = '0.' + xr.join('');
                     //     return Ext.util.Format.number(v, format);
                     // },
-                    exportStyle:{
+                    exportStyle: {
                         format: c.exportFormat || 'Total',
                         alignment: {
                             horizontal: 'Right'
@@ -337,7 +375,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
     initSummaryType: function (column) {
         var summaryType = column.summaryType;
         if (Ext.isString(summaryType)) {
-            summaryType = summaryType.replace('customize_','');
+            summaryType = summaryType.replace('customize_', '');
             column.summaryTypeName = summaryType;
         }
         if (summaryType == 'sum') {
@@ -346,12 +384,12 @@ Ext.define('saas.view.core.report.ReportPanel', {
             column.summaryType = function (records, values) {
                 return Ext.Array.sum(values);
             }
-        } else if(summaryType == 'last') {
+        } else if (summaryType == 'last') {
             column._summaryType = 'last';
             column.summaryType = function (records, values) {
                 return values[values.length - 1];
             }
-        }else {
+        } else {
             column._summaryType = summaryType;
         }
     },
@@ -570,5 +608,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     applyParams: function (p) {
         return p;
+    },
+
+    refreshViewConfig: function () {
+        var me = this;
+        me.refreshColumns();
     }
 });

+ 54 - 18
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -11,16 +11,16 @@ Ext.define('saas.view.core.report.ReportPanelController', {
 
     onQuery: function (btn) {
         var me = this,
-        reportPanel = me.getView(),
-        grid = reportPanel.getListGrid();
+            reportPanel = me.getView(),
+            grid = reportPanel.getListGrid();
 
-        if(reportPanel.fireEvent('beforequery', reportPanel) == false) {
+        if (reportPanel.fireEvent('beforequery', reportPanel) == false) {
             return false;
-        }else {
+        } else {
             grid.store.loadPage(1);
         }
     },
-    exportTo:function(btn){
+    exportTo: function (btn) {
         var me = this,
             reportPanel = me.getView(),
             grid = reportPanel.getListGrid(),
@@ -28,31 +28,31 @@ Ext.define('saas.view.core.report.ReportPanelController', {
 
         var cfg = Ext.merge({
             title: title,
-            titleStyle:{
-                alignment:{
-                    horizontal:'Center', vertical:'Center'
+            titleStyle: {
+                alignment: {
+                    horizontal: 'Center',
+                    vertical: 'Center'
                 }
                 //font:
             },
-            fileName: title + Ext.Date.format(new Date(),'Y-m-d H-i-s') +'.' + (btn.cfg.ext || btn.cfg.type)
+            fileName: title + Ext.Date.format(new Date(), 'Y-m-d H-i-s') + '.' + (btn.cfg.ext || btn.cfg.type)
         }, btn.cfg);
         grid.store.exportPageSize = 5000;
         grid.store.exportNumber = 1;
-        grid.store.load(function(records, operation, success) {
-            if(btn.cfg.isPrint){
+        grid.store.load(function (records, operation, success) {
+            if (btn.cfg.isPrint) {
                 me.printHtml(grid.getDocumentData(cfg));
-            }else  {
+            } else {
                 grid.saveDocumentAs(cfg);
             }
             grid.store.exportPageSize = null;
             grid.store.exportNumber = null;
-            grid.store.load(function(records, operation, success) {
-            });
+            grid.store.load(function (records, operation, success) {});
         });
     },
-    printHtml: function(html){
-        var iframe=document.getElementById("saas-print-iframe");
-        if(!iframe){
+    printHtml: function (html) {
+        var iframe = document.getElementById("saas-print-iframe");
+        if (!iframe) {
             iframe = document.createElement('IFRAME');
             var doc = null;
             iframe.setAttribute("id", "saas-print-iframe");
@@ -64,8 +64,44 @@ Ext.define('saas.view.core.report.ReportPanelController', {
         doc.close();
         iframe.contentWindow.focus();
         iframe.contentWindow.print();
-        if (navigator.userAgent.indexOf("MSIE") > 0){
+        if (navigator.userAgent.indexOf("MSIE") > 0) {
             document.body.removeChild(iframe);
         }
     },
+    onColSetting: function() {
+        var me = this,
+        panel = me.getView(),
+        viewName = panel.viewName,
+        columns = panel.defaultColumns,
+        items = [];
+
+        for(let i = 0; i < columns.length; i++) {
+            let col = columns[i];
+            if(!col.initHidden) {
+                items.push(Object.assign({}, col));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, 'columns');
+    },
+
+    openSettingWindow: function(viewName, items, settype) {
+        var panel = saas.util.BaseUtil.getCurrentTab(),
+        box = panel.getBox(),
+        refs = panel.getReferences() || {},
+        win = refs.settingwin;
+
+        title = '列设置';
+
+        if(!win) {
+            win = panel.add({
+                title: title,
+                xtype: 'settingwin',
+                viewName: viewName,
+                fieldItems: Ext.Array.clone(items),
+                settype: settype,
+            });
+        }
+        win.show();
+    }
 });

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

@@ -22,7 +22,8 @@ Ext.define('saas.view.core.tab.Controller', {
         }
     },
 
-    onTabActivate: function(component) {
+    onTabActivate: function() {
+        var component = this.getView();
         var tabView = component.down('container');
 
         if(tabView && typeof tabView.refresh == 'function') {

+ 2 - 3
frontend/saas-web/app/view/document/address/DataList.js

@@ -63,9 +63,8 @@ Ext.define('saas.view.document.address.DataList', {
                                 grid.store.load();
                             }
                         })
-                        .catch(function(res) {
-                            console.error(res);
-                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        .catch(function(e) {
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
                         });
                     }
                 }]

+ 3 - 3
frontend/saas-web/app/view/document/address/DatalistController.js

@@ -28,9 +28,9 @@ Ext.define('saas.view.document.address.DatalistController', {
                         grid.store.load();
                     }
                 })
-                .catch(function(res) {
-                    console.error(res);
-                    saas.util.BaseUtil.showErrorToast('删除失败: ' + res.message);
+                .catch(function(e) {
+                    console.error(e);
+                    saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                 });
             }
         });

+ 110 - 101
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -4,111 +4,120 @@ Ext.define('saas.view.document.bom.BasePanel', {
 
     controller: 'document-bom-basepanel',
     viewModel: 'document-bom-basepanel',
+    
+    viewName: 'document-bom-basepanel',
 
     deleteMoreMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
     deleteOneMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
-    searchField:[{
-        xtype : "textfield", 
-        name : "bo_mothercode", 
-        width:200, 
-        emptyText:'请输入产品编号或名称',
-        getCondition: function(value) {
-           return  ' (bo_mothername like\'%' + value + '%\'' 
-                +' or bo_mothercode like \'%'+value+'%\' ) ';
-        }
-    },{
-        xtype : "textfield", 
-        name : "bo_version", 
-        fieldLabel:'版本号',
-        emptyText: '全部',
-    },{
-        xtype: 'combobox',
-        name: 'bo_statuscode',
-        queryMode: 'local',
-        displayField: 'bo_status',
-        valueField: 'bo_statuscode',
-        fieldLabel :'状态',
-        emptyText: '全部',
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['bo_statuscode', 'bo_status'],
-        data: [
-            ["ALL", "全部"],
-            ["ENABLE", "已启用"],
-            ["BANNED", "已禁用"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL'||value==null) {
-                return '1=1';
-            }else {
-                return 'bo_statuscode=\'' + value + '\'';
-            }
-        }
-    
-    }],
-
-    //字段属性
-    _formXtype:'document-bom-formpanel',
-    _title:'BOM资料',
-    caller:'Bom',
-    _deleteUrl:'/api/document/bom/delete',
-    _batchOpenUrl:'/api/document/bom/batchOpen',
-    _batchCloseUrl:'/api/document/bom/batchClose',
-    _batchDeleteUrl:'/api/document/bom/batchDelete',
 
-    gridConfig: {
-        idField: 'id',
-        codeField: 'bo_mothercode',
-        statusCodeField:'bo_statuscode',
-        dataUrl: '/api/document/bom/list',
-        caller: 'Bom',
-        columns : [{
-            text : "id", 
-            width : 0, 
-            dataIndex : "id", 
-            xtype : "numbercolumn",   
-        },{
-            text : "产品id", 
-            width : 0, 
-            dataIndex : "bo_motherid", 
-            xtype : "numbercolumn",   
-        },{
-            text : "产品编号", 
-            dataIndex : "bo_mothercode",
-            width : 150.0,
-        }, 
-        {
-            text : "产品名称", 
-            dataIndex : "bo_mothername", 
-            width :200.0, 
-        }, 
-        {
-            text : "产品型号", 
-            dataIndex : "pr_orispeccode", 
-            width :150.0, 
-        }, 
-        {
-            text : "产品规格", 
-            dataIndex : "pr_spec", 
-            width :150.0, 
-        }, 
-        {
-            text : "产品状态", 
-            dataIndex : "bo_status", 
-            align:'center',
-            width : 90.0, 
-        }, 
-        {
-            text : "产品状态码", 
-            dataIndex : "bo_statuscode", 
-            width : 0, 
-        },
-        {   
-            text : "版本号", 
-            dataIndex : "bo_version", 
-            width :100.0, 
-        }]
+    initComponent: function() {
+        var me = this;
+            Ext.apply(me, {
+                searchField:[{
+                    xtype : "textfield", 
+                    name : "bo_mothercode", 
+                    width:200, 
+                    emptyText:'请输入产品编号或名称',
+                    getCondition: function(value) {
+                       return  ' (bo_mothername like\'%' + value + '%\'' 
+                            +' or bo_mothercode like \'%'+value+'%\' ) ';
+                    }
+                },{
+                    xtype : "textfield", 
+                    name : "bo_version", 
+                    fieldLabel:'版本号',
+                    emptyText: '全部',
+                },{
+                    xtype: 'combobox',
+                    name: 'bo_statuscode',
+                    queryMode: 'local',
+                    displayField: 'bo_status',
+                    valueField: 'bo_statuscode',
+                    fieldLabel :'状态',
+                    emptyText: '全部',
+                    editable:false,
+                    store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['bo_statuscode', 'bo_status'],
+                    data: [
+                        ["ALL", "全部"],
+                        ["ENABLE", "已启用"],
+                        ["BANNED", "已禁用"]
+                    ]
+                    }),
+                    getCondition: function(value) {
+                        if(value == 'ALL'||value==null) {
+                            return '1=1';
+                        }else {
+                            return 'bo_statuscode=\'' + value + '\'';
+                        }
+                    }
+                
+                }],
+            
+                //字段属性
+                _formXtype:'document-bom-formpanel',
+                _title:'BOM资料',
+                caller:'Bom',
+                _deleteUrl:'/api/document/bom/delete',
+                _batchOpenUrl:'/api/document/bom/batchOpen',
+                _batchCloseUrl:'/api/document/bom/batchClose',
+                _batchDeleteUrl:'/api/document/bom/batchDelete',
+            
+                gridConfig: {
+                    idField: 'id',
+                    codeField: 'bo_mothercode',
+                    statusCodeField:'bo_statuscode',
+                    dataUrl: '/api/document/bom/list',
+                    caller: 'Bom',
+                    columns : [{
+                        text : "id", 
+                        width : 0, 
+                        dataIndex : "id", 
+                        xtype : "numbercolumn",   
+                    },{
+                        text : "产品id", 
+                        width : 0, 
+                        dataIndex : "bo_motherid", 
+                        xtype : "numbercolumn",   
+                    },{
+                        text : "产品编号", 
+                        dataIndex : "bo_mothercode",
+                        width : 150.0,
+                    }, 
+                    {
+                        text : "产品名称", 
+                        dataIndex : "bo_mothername", 
+                        width :200.0, 
+                    }, 
+                    {
+                        text : "产品型号", 
+                        dataIndex : "pr_orispeccode", 
+                        width :150.0, 
+                    }, 
+                    {
+                        text : "产品规格", 
+                        dataIndex : "pr_spec", 
+                        width :150.0, 
+                    }, 
+                    {
+                        text : "产品状态", 
+                        dataIndex : "bo_status", 
+                        align:'center',
+                        width : 90.0, 
+                    }, 
+                    {
+                        text : "产品状态码", 
+                        dataIndex : "bo_statuscode", 
+                        width : 0, 
+                    },
+                    {   
+                        text : "版本号", 
+                        dataIndex : "bo_version", 
+                        width :100.0, 
+                    }]
+                },
+            });
+        me.callParent(arguments);
     },
 
     refresh:function(){

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

@@ -89,9 +89,9 @@ Ext.define('saas.view.document.bom.FormController', {
                 saas.util.BaseUtil.showSuccessToast('启用成功');
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('启用失败: ' + res.message);
+        .catch(function(e) {
+            console.error(e);
+            saas.util.BaseUtil.showErrorToast('启用失败: ' + e.message);
         });
     },
     unAudit: function() {

+ 237 - 162
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -4,25 +4,26 @@ Ext.define('saas.view.document.bom.FormPanel', {
 
     controller: 'document-bom-formpanel',
     viewModel: 'document-bom-formpanel',
-    
-    caller:'Bom',
+
+    viewName: 'document-bom-formpanel',
+    caller: 'Bom',
 
     //字段属性
-    _title:'BOM资料',
+    _title: 'BOM资料',
     _idField: 'id',
     _codeField: 'codefied',
     _statusField: 'bo_status',
     _statusCodeField: 'bo_statuscode',
-    _readUrl:'/api/document/bom/read',
-    _saveUrl:'/api/document/bom/save',
-    _openUrl:'/api/document/bom/open',
-    _closeUrl:'/api/document/bom/close',
-    _deleteUrl:'/api/document/bom/delete',
-    initId:0,
+    _readUrl: '/api/document/bom/read',
+    _saveUrl: '/api/document/bom/save',
+    _openUrl: '/api/document/bom/open',
+    _closeUrl: '/api/document/bom/close',
+    _deleteUrl: '/api/document/bom/delete',
+    initId: 0,
     _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
     codeInHeader: false,
 
-    defaultButtons:[{
+    defaultButtons: [{
         cls: 'x-formpanel-btn-blue',
         xtype: 'button',
         text: '新增',
@@ -61,198 +62,272 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 xtype: 'hidden',
                 name: 'id',
                 fieldLabel: 'id',
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 'bo_motherid',
                 fieldLabel: '产品id'
-            },{
-                xtype : "productDbfindTrigger", 
+            }, {
+                xtype: "productDbfindTrigger",
                 name: 'bo_mothercode',
                 fieldLabel: '产品编号',
                 allowBlank: false
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_brand',
                 fieldLabel: '品牌',
-                readOnly:true,
-            },{
+                readOnly: true,
+            }, {
                 xtype: 'textfield',
                 name: 'bo_mothername',
                 fieldLabel: '产品名称',
-                readOnly:true,
+                readOnly: true,
                 allowBlank: false
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_orispeccode',
                 fieldLabel: '产品型号',
-                readOnly:true,
-            },{
+                readOnly: true,
+            }, {
                 xtype: 'textfield',
                 name: 'pr_spec',
                 fieldLabel: '产品规格',
-                readOnly:true,
-                ignore:true
-            },{
+                readOnly: true,
+                ignore: true
+            }, {
                 xtype: 'textfield',
                 name: 'bo_version',
                 fieldLabel: '版本号',
                 allowBlank: false
             }, {
-                xtype : "detailGridField",
+                xtype: "detailGridField",
+                name: 'detailGridField',
                 detnoColumn: 'bd_detno',
                 showCount: false,
-                storeModel:'saas.model.document.bomdetail',
-                deleteDetailUrl:'/api/document/bom/deleteDetail',
-                columns : [
-                    {
-                        text : "ID", 
-                        dataIndex : "id", 
-                        hidden : true, 
-                        xtype : "numbercolumn"
-                    }, {
-                        text : "关联ID", 
-                        dataIndex : "bd_bomid", 
-                        hidden : true,  
-                        xtype : "numbercolumn"
-                    }, {
-                        allowBlank:false,
-                        text : "物料编号", 
-                        dataIndex : "bd_soncode", 
-                        width : 150, 
-                        editor : {
-                            displayField : "display", 
-                            editable : true, 
-                            format : "", 
-                            hideTrigger : false, 
-                            maxLength : 100.0, 
-                            minValue : null, 
-                            positiveNum : false, 
-                            queryMode : "local", 
-                            store : null, 
-                            valueField : "value", 
-                            xtype : "productMultiDbfindTrigger"
-                        }
-                    }, {
-                        allowBlank:false,
-                        text : "物料ID", 
-                        hidden : true, 
-                        dataIndex : "bd_sonid", 
-                    }, {
-                        text: 'model映射需要',
-                        dataIndex: 'productDTO',
-                        hidden: true,
-                    }, {
-                        text : "品牌", 
-                        width : 100.0, 
-                        dataIndex : "pr_brand",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    }, {
-                        text : "物料名称", 
-                        width : 150.0, 
-                        dataIndex : "pr_detail",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                storeModel: 'saas.model.document.bomdetail',
+                deleteDetailUrl: '/api/document/bom/deleteDetail',
+                columns: [{
+                    text: "ID",
+                    dataIndex: "id",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: "关联ID",
+                    dataIndex: "bd_bomid",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    allowBlank: false,
+                    text: "物料编号",
+                    dataIndex: "bd_soncode",
+                    width: 150,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    allowBlank: false,
+                    text: "物料ID",
+                    hidden: true,
+                    dataIndex: "bd_sonid",
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },
-                    {
-                        text : "型号", 
-                        width : 200.0, 
-                        dataIndex : "pr_orispeccode",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },{
-                        text : "规格", 
-                        width : 200, 
-                        dataIndex : "pr_spec",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    }, {
-                        allowBlank:false,
-                        text : "用量", 
-                        width : 110, 
-                        xtype : "numbercolumn",
-                        dataIndex : "bd_baseqty",
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 3,
-                            minValue:0,
-                            maxLength: 10,
-                            align: 'end'
-                        },
-                        renderer : function(v) {
-                            return saas.util.BaseUtil.numberFormat(v, 3, false);
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    }, {
-                        text : "单位", 
-                        dataIndex : "bd_unit", 
-                        width : 65 
-                    }, {
-                        text : "替代料", 
-                        dataIndex : "bd_replace", 
-                        width : 250, 
-                        editor : {
-                            displayField : "display", 
-                            editable : true, 
-                            format : "", 
-                            hideTrigger : false, 
-                            maxLength : 100.0, 
-                            minValue : null, 
-                            positiveNum : false, 
-                            queryMode : "local", 
-                            store : null, 
-                            valueField : "value", 
-                            xtype : "productAddMultiDbfindTrigger"
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    }, {
-                        text : "备注", 
-                        dataIndex : "bd_remark",
-                        width : 250, 
-                        items : null,
-                        editor : {
-                            xtype : "textfield"
-                        },
-                    }]
+                        return v;
+                    }
+                }, {
+                    allowBlank: false,
+                    text: "用量",
+                    width: 110,
+                    xtype: "numbercolumn",
+                    dataIndex: "bd_baseqty",
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0,
+                        maxLength: 10,
+                        align: 'end'
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    dataIndex: "bd_unit",
+                    width: 65
+                }, {
+                    text: "替代料",
+                    dataIndex: "bd_replace",
+                    width: 250,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productAddMultiDbfindTrigger"
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "bd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "bd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "bd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "bd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "bd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "bd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
             }, {
                 xtype: 'hidden',
                 name: 'bo_statuscode',
                 fieldLabel: '状态码',
-                readOnly:true,
+                readOnly: true,
                 defaultValue: ''
             }, {
                 xtype: 'textfield',
                 name: 'bo_status',
                 fieldLabel: '产品状态',
-                readOnly:true,
+                readOnly: true,
                 defaultValue: ''
-            },{  
-                xtype : "textfield", 
-                name : "creatorName", 
-                readOnly:true,
-                fieldLabel : "录入人"
-            },{
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "录入时间"
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                readOnly: true,
+                fieldLabel: "录入人"
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入时间"
+            }, {
+                xtype: "textfield",
+                name: "bo_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "bo_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "bo_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "bo_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "bo_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
         });
         this.callParent(arguments);

+ 122 - 112
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -5,55 +5,11 @@ Ext.define('saas.view.document.customer.BasePanel', {
     controller: 'document-customer-basepanel',
     viewModel: 'document-customer-basepanel',
 
+    viewName: 'document-customer-basepanel',
+
     deleteMoreMsg: '删除的客户资料将不能恢复,请确认是否删除?',
     deleteOneMsg: '删除的客户资料将不能恢复,请确认是否删除?',
 
-    searchField:[{
-        xtype : "textfield", 
-        name : "cu_code", 
-        width:200, 
-        emptyText:'请输入客户编号或名称',
-        getCondition: function (v) {
-            return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
-        }
-    }, {
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/customerkind/getCombo',
-        name : "cu_type", 
-        fieldLabel : "客户类型", 
-        emptyText: '全部',
-        hiddenBtn:true
-    }, {
-        xtype : "employeeDbfindTrigger", 
-        name : "cu_sellername", 
-        fieldLabel:'业务员',
-        emptyText: '输入人员编号或姓名',
-    },{
-        xtype: 'combobox',
-        name: 'cu_statuscode',
-        queryMode: 'local',
-        displayField: 'cu_status',
-        valueField: 'cu_statuscode',
-        fieldLabel :'状态',
-        emptyText: '全部',
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['cu_statuscode', 'cu_status'],
-        data: [
-            ["ALL", "全部"],
-            ["ENABLE", "已启用"],
-            ["BANNED", "已禁用"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL'||value==null) {
-                return '1=1';
-            }else {
-                return 'cu_statuscode=\'' + value + '\'';
-            }
-        }
-    }],
-
     //字段属性
     caller:'Customer',
     _formXtype:'document-customer-formpanel',
@@ -63,73 +19,127 @@ Ext.define('saas.view.document.customer.BasePanel', {
     _batchCloseUrl:'/api/document/customer/batchClose',
     _batchDeleteUrl:'/api/document/customer/batchDelete',
 
-    gridConfig: {
-        idField: 'id',
-        codeField: 'cu_code',
-        statusCodeField:'cu_statuscode',
-        dataUrl: '/api/document/customer/list',
-        caller: 'Customer',
-        columns : [
-        {
-            text : "客户id", 
-            hidden:true,
-            dataIndex : "id", 
-            xtype : "numbercolumn", 
-        },{
-            text : "客户编号", 
-            width : 150.0, 
-            dataIndex : "cu_code"
-        },{
-            text : "客户简称", 
-            width : 150.0, 
-            dataIndex : "cu_shortname",
-            hidden: true
-        }, 
-        {
-            text : "客户名称", 
-            width : 200.0, 
-            dataIndex : "cu_name"
-        }, {
-            text : "状态", 
-            dataIndex : "cu_status", 
-            align: 'center',
-            width : 80.0
-        }, {
-            text : "类型", 
-            dataIndex : "cu_type", 
-            width : 100.0
-        }, {
-            text : "税率(%)", 
-            dataIndex : "cu_taxrate", 
-            xtype: 'numbercolumn', 
-            width : 80.0, 
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, false);
-            }
-        }, {
-            text : "结算天数", 
-            xtype: 'numbercolumn',
-            dataIndex : "cu_promisedays", 
-            renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            }
-        }, {
-            text: '应收余额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'cu_leftamount',
-            width: 120,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            searchField:[{
+                xtype : "textfield", 
+                name : "cu_code", 
+                width:200, 
+                emptyText:'请输入客户编号或名称',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
+                }
+            }, {
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/customerkind/getCombo',
+                name : "cu_type", 
+                fieldLabel : "客户类型", 
+                emptyText: '全部',
+                hiddenBtn:true
+            }, {
+                xtype : "employeeDbfindTrigger", 
+                name : "cu_sellername", 
+                fieldLabel:'业务员',
+                emptyText: '输入人员编号或姓名',
+            },{
+                xtype: 'combobox',
+                name: 'cu_statuscode',
+                queryMode: 'local',
+                displayField: 'cu_status',
+                valueField: 'cu_statuscode',
+                fieldLabel :'状态',
+                emptyText: '全部',
+                editable:false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                fields: ['cu_statuscode', 'cu_status'],
+                data: [
+                    ["ALL", "全部"],
+                    ["ENABLE", "已启用"],
+                    ["BANNED", "已禁用"]
+                ]
+                }),
+                getCondition: function(value) {
+                    if(value == 'ALL'||value==null) {
+                        return '1=1';
+                    }else {
+                        return 'cu_statuscode=\'' + value + '\'';
+                    }
+                }
+            }],
+        
+            gridConfig: {
+                idField: 'id',
+                codeField: 'cu_code',
+                statusCodeField:'cu_statuscode',
+                dataUrl: '/api/document/customer/list',
+                caller: 'Customer',
+                columns : [
+                {
+                    text : "客户id", 
+                    hidden:true,
+                    dataIndex : "id", 
+                    xtype : "numbercolumn", 
+                },{
+                    text : "客户编号", 
+                    width : 150.0, 
+                    dataIndex : "cu_code"
+                },{
+                    text : "客户简称", 
+                    width : 150.0, 
+                    dataIndex : "cu_shortname",
+                    hidden: true
+                }, 
+                {
+                    text : "客户名称", 
+                    width : 200.0, 
+                    dataIndex : "cu_name"
+                }, {
+                    text : "状态", 
+                    dataIndex : "cu_status", 
+                    align: 'center',
+                    width : 80.0
+                }, {
+                    text : "类型", 
+                    dataIndex : "cu_type", 
+                    width : 100.0
+                }, {
+                    text : "税率(%)", 
+                    dataIndex : "cu_taxrate", 
+                    xtype: 'numbercolumn', 
+                    width : 80.0, 
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                }, {
+                    text : "结算天数", 
+                    xtype: 'numbercolumn',
+                    dataIndex : "cu_promisedays", 
+                    renderer : function(v) {
+                        return Ext.util.Format.number(v, '0');
+                    }
+                }, {
+                    text: '应收余额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'cu_leftamount',
+                    width: 120,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text : "业务员", 
+                    dataIndex : "cu_sellername",
+                    width: 110
+                }, {
+                    text : "备注", 
+                    dataIndex : "cu_remark",
+                    width: 250
+                }]
             }
-        }, {
-            text : "业务员", 
-            dataIndex : "cu_sellername",
-            width: 110
-        }, {
-            text : "备注", 
-            dataIndex : "cu_remark",
-            width: 250
-        }]
+        });
+
+        me.callParent(arguments);
     },
 
     refresh:function(){

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

@@ -48,9 +48,8 @@ Ext.define('saas.view.document.customer.FormController', {
                 viewModel.set('base.editable', false);
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('启用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('启用失败: ' + e.message);
         });
     },
     unAudit: function() {
@@ -71,8 +70,8 @@ Ext.define('saas.view.document.customer.FormController', {
                 saas.util.BaseUtil.showSuccessToast('禁用成功');
             }
         })
-        .catch(function(res) {
-            saas.util.BaseUtil.showErrorToast('禁用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('禁用失败: ' + e.message);
         });
     }
 });

+ 358 - 254
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -4,25 +4,26 @@ Ext.define('saas.view.document.customer.FormPanel', {
 
     controller: 'document-customer-formpanel',
     viewModel: 'document-customer-formpanel',
-    
-    caller:'Customer',
+
+    viewName: 'document-customer-formpanel',
+    caller: 'Customer',
 
     //字段属性
-    _title:'客户资料',
+    _title: '客户资料',
     _idField: 'id',
     _codeField: 'cu_code',
     _statusField: 'cu_status',
     _statusCodeField: 'cu_statuscode',
-    _readUrl:'/api/document/customer/read',
-    _saveUrl:'/api/document/customer/save',
-    _openUrl:'/api/document/customer/open',
-    _closeUrl:'/api/document/customer/close',
-    _deleteUrl:'/api/document/customer/delete',
-    initId:0,
+    _readUrl: '/api/document/customer/read',
+    _saveUrl: '/api/document/customer/save',
+    _openUrl: '/api/document/customer/open',
+    _closeUrl: '/api/document/customer/close',
+    _deleteUrl: '/api/document/customer/delete',
+    initId: 0,
 
     codeInHeader: false,
 
-    defaultButtons:[{
+    defaultButtons: [{
         cls: 'x-formpanel-btn-blue',
         xtype: 'button',
         text: '新增',
@@ -63,333 +64,436 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 allowBlank: true,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'cu_code',
                 fieldLabel: '客户编号',
                 allowBlank: false,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'cu_name',
                 fieldLabel: '客户名称',
                 allowBlank: false,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'cu_shortname',
                 fieldLabel: '客户简称',
                 columnWidth: 0.25,
                 hidden: true,
                 group: '基础信息',
-            },{
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/customerkind/getCombo',
-                name : "cu_type", 
-                fieldLabel : "客户类型", 
-                columnWidth : 0.25,
-                hiddenBtn:false,//true 则会关闭新增按钮功能,
+            }, {
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/customerkind/getCombo',
+                name: "cu_type",
+                fieldLabel: "客户类型",
+                columnWidth: 0.25,
+                hiddenBtn: false, //true 则会关闭新增按钮功能,
                 group: '基础信息',
-                addHandler:function(b){
-                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                addHandler: function (b) {
+                    var document = Ext.create('saas.view.document.kind.Kind', {});
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.getController().getView().add({
                         xtype: 'document-kind-childwin',
                         bind: {
                             title: '新增客户类型'
                         },
-                        dataKind:'customerkind',
-                        belong:document.etc['customerkind'],
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        dataKind: 'customerkind',
+                        belong: document.etc['customerkind'],
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
                 }
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 'cu_status',
                 fieldLabel: '状态',
                 allowBlank: true,
                 columnWidth: 0
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 'cu_statuscode',
                 fieldLabel: '状态码',
                 allowBlank: true,
                 columnWidth: 0.25
-            },{
-                xtype : "datefield", 
-                name : "cu_begindate", 
-                format:'Y-m-d',
-                fieldLabel : "期初日期", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "datefield",
+                name: "cu_begindate",
+                format: 'Y-m-d',
+                fieldLabel: "期初日期",
+                allowBlank: true,
+                columnWidth: 0.25,
                 group: '交易信息',
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "cu_beginaramount", 
-                fieldLabel : "期初应收(元)", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "cu_beginaramount",
+                fieldLabel: "期初应收(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "cu_beginprerecamount", 
-                fieldLabel : "期初预收(元)", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "cu_beginprerecamount",
+                fieldLabel: "期初预收(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },   
-            },{
-                xtype:'textfield',
-                name : "cu_leftamount", 
-                fieldLabel : "应收余额(元)", 
-                allowBlank : true, 
-                readOnly:true,
-                columnWidth : 0.25,
+                },
+            }, {
+                xtype: 'textfield',
+                name: "cu_leftamount",
+                fieldLabel: "应收余额(元)",
+                allowBlank: true,
+                readOnly: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            },{
-                xtype : "numberfield", 
-                name : "cu_taxrate", 
-                fieldLabel : "税率(%)", 
-                allowBlank : false, 
-                columnWidth : 0.25,
-                minValue:0,
-                maxValue:100,
+            }, {
+                xtype: "numberfield",
+                name: "cu_taxrate",
+                fieldLabel: "税率(%)",
+                allowBlank: false,
+                columnWidth: 0.25,
+                minValue: 0,
+                maxValue: 100,
                 group: '交易信息',
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "cu_promisedays", 
-                fieldLabel : "结算天数", 
-                allowBlank : true, 
-                columnWidth : 0.25,
-                decimalPrecision:0,
-                minValue:0,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "cu_promisedays",
+                fieldLabel: "结算天数",
+                allowBlank: true,
+                columnWidth: 0.25,
+                decimalPrecision: 0,
+                minValue: 0,
                 group: '交易信息',
             }, {
-                xtype : "hidden", 
-                name : "cu_sellerid", 
-                fieldLabel : "业务员id",
-                defaultValue:saas.util.BaseUtil.getCurrentUser().id,
+                xtype: "hidden",
+                name: "cu_sellerid",
+                fieldLabel: "业务员id",
+                defaultValue: saas.util.BaseUtil.getCurrentUser().id,
                 group: '交易信息',
             }, {
-                xtype : "hidden", 
-                name : "cu_sellercode", 
-                fieldLabel : "业务员code",
+                xtype: "hidden",
+                name: "cu_sellercode",
+                fieldLabel: "业务员code",
                 group: '交易信息',
             }, {
-                xtype : "employeeDbfindTrigger", 
-                name : "cu_sellername", 
-                fieldLabel : "业务员",  
-                columnWidth : 0.25,
-                defaultValue:saas.util.BaseUtil.getCurrentUser().realname,
+                xtype: "employeeDbfindTrigger",
+                name: "cu_sellername",
+                fieldLabel: "业务员",
+                columnWidth: 0.25,
+                defaultValue: saas.util.BaseUtil.getCurrentUser().realname,
                 group: '交易信息',
-            },{
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "cu_credit", 
-                fieldLabel : "额度", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "hidden",
+                hideTrigger: true,
+                name: "cu_credit",
+                fieldLabel: "额度",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
-                minValue:0,
+                minValue: 0,
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            },{
-                xtype : "hidden", 
-                name : "cu_nsrzh", 
-                fieldLabel : "纳税人识别号", 
-                allowBlank : true, 
-                columnWidth : 0.25
-            },{
-                xtype : "hidden", 
-                name : "cu_bankaccount", 
-                fieldLabel : "开户银行", 
-                allowBlank : true, 
-                columnWidth : 0.25
-            },{
-                xtype : "hidden",  
-                name : "cu_bankcode", 
-                fieldLabel : "银行账户", 
-                allowBlank : true, 
-                columnWidth : 0.25
-            },{
-                xtype:'hidden',
-                name : "cu_uu", 
-                fieldLabel : "客户UU", 
-                allowBlank : true, 
-                readOnly:true,
-                editable:false,
-                columnWidth : 0.25
-            },{
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "创建时间", 
-                allowBlank : true, 
-                hidden:true,
-                columnWidth : 0
-            },{  
-                xtype : "datefield", 
-                name : "updateTime", 
-                fieldLabel : "更新时间", 
-                allowBlank : true, 
-                hidden:true,
-                columnWidth : 0
-            },{
-                fieldLabel : "备注", 
-                xtype:'textfield',
-                name : "cu_remark",
-                columnWidth : 1
             }, {
-                xtype : "detailGridField",
-                name: 'detailGridField',
-                storeModel:'saas.model.document.customercontact',
+                xtype: "hidden",
+                name: "cu_nsrzh",
+                fieldLabel: "纳税人识别号",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "cu_bankaccount",
+                fieldLabel: "开户银行",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "cu_bankcode",
+                fieldLabel: "银行账户",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: 'hidden',
+                name: "cu_uu",
+                fieldLabel: "客户UU",
+                allowBlank: true,
+                readOnly: true,
+                editable: false,
+                columnWidth: 0.25
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "创建时间",
+                allowBlank: true,
+                hidden: true,
+                columnWidth: 0
+            }, {
+                xtype: "datefield",
+                name: "updateTime",
+                fieldLabel: "更新时间",
+                allowBlank: true,
+                hidden: true,
+                columnWidth: 0
+            }, {
+                fieldLabel: "备注",
+                xtype: 'textfield',
+                name: "cu_remark",
+                columnWidth: 1
+            }, {
+                xtype: "detailGridField",
+                name: 'detail1',
+                storeModel: 'saas.model.document.customercontact',
                 detnoColumn: 'cc_detno',
                 showCount: false,
-                deleteDetailUrl:'/api/document/customer/deletecontact',
-                minHeight:145,
+                deleteDetailUrl: '/api/document/customer/deletecontact',
+                minHeight: 145,
                 emptyRows: 3,
-                columns : [
-                    {
-                        text : "ID", 
-                        dataIndex : "id", 
-                        hidden : true,  
-                        xtype : "numbercolumn"
+                columns: [{
+                    text: "ID",
+                    dataIndex: "id",
+                    initHidden: true,
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: "关联ID",
+                    dataIndex: "cc_cuid",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    allowBlank: false,
+                    text: "联系人",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "关联ID", 
-                        dataIndex : "cc_cuid", 
-                        hidden : true,  
-                        xtype : "numbercolumn"
+                    dataIndex: "cc_name",
+                    width: 110
+                }, {
+                    allowBlank: false,
+                    text: "电话",
+                    editor: {
+                        // regex:/^1(3|4|5|7|8|9)\d{9}$/,
+                        // regexText:'请输入正确的手机号码',
+                        hideTrigger: true,
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:false,
-                        text : "联系人", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "cc_name", 
-                        width:110  
+                    dataIndex: "cc_tel",
+                    width: 200
+                }, {
+                    allowBlank: true,
+                    text: "微信/QQ",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:false,
-                        text : "电话", 
-                        editor : {
-                            // regex:/^1(3|4|5|7|8|9)\d{9}$/,
-                            // regexText:'请输入正确的手机号码',
-                            hideTrigger:true,
-                            xtype : "textfield"
-                        },
-                        dataIndex : "cc_tel", 
-                        width:200 
+                    dataIndex: "cc_qq",
+                    width: 110
+                }, {
+                    text: "邮箱",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:true,
-                        text : "微信/QQ", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "cc_qq", 
-                        width:110 
+                    dataIndex: "cc_email",
+                    width: 180
+                }, {
+                    text: "默认联系人",
+                    width: 110,
+                    dataIndex: "cc_default",
+                    xtype: "yncolumn"
+                }, {
+                    dataIndex: "cc_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "邮箱", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "cc_email", 
-                        width:180 
+                }, {
+                    dataIndex: "cc_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "cc_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "默认联系人", 
-                        width:110 ,
-                        dataIndex : "cc_default", 
-                        xtype : "yncolumn"
-                    }]
-            } ,{
-                xtype : "detailGridField",
-                name: 'detailGridField',
-                storeModel:'saas.model.document.customeraddress',
+                }, {
+                    dataIndex: "cc_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "cc_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: "detailGridField",
+                name: 'detail2',
+                storeModel: 'saas.model.document.customeraddress',
                 detnoColumn: 'ca_detno',
                 showCount: false,
-                deleteDetailUrl:'/api/document/customer/deleteaddress',
-                minHeight:145,
+                deleteDetailUrl: '/api/document/customer/deleteaddress',
+                minHeight: 145,
                 emptyRows: 3,
-                columns : [
-                    {
-                        text : "ID", 
-                        dataIndex : "id", 
-                        hidden : true, 
-                        xtype : "numbercolumn"
+                columns: [{
+                    text: "ID",
+                    dataIndex: "id",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: "关联ID",
+                    dataIndex: "ca_cuid",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    allowBlank: false,
+                    text: "送货地址",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "关联ID", 
-                        dataIndex : "ca_cuid", 
-                        hidden : true,  
-                        xtype : "numbercolumn"
+                    dataIndex: "ca_address",
+                    width: 300
+                }, {
+                    allowBlank: true,
+                    text: "联系人",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:false,
-                        text : "送货地址", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "ca_address", 
-                        width:300 
-                    },  
-                    {
-                        allowBlank:true,
-                        text : "联系人", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "ca_person", 
-                        width:110   
+                    dataIndex: "ca_person",
+                    width: 110
+                }, {
+                    allowBlank: true,
+                    text: "联系电话",
+                    editor: {
+                        // regex:/^1(3|4|5|7|8|9)\d{9}$/,
+                        // regexText:'请输入正确的手机号码',
+                        xtype: "textfield",
+                        hideTrigger: true,
                     },
-                    {
-                        allowBlank:true,
-                        text : "联系电话", 
-                        editor : {
-                            // regex:/^1(3|4|5|7|8|9)\d{9}$/,
-                            // regexText:'请输入正确的手机号码',
-                            xtype : "textfield",
-                            hideTrigger:true,
-                        },
-                        dataIndex : "ca_phone", 
-                        width:200  
+                    dataIndex: "ca_phone",
+                    width: 200
+                }, {
+                    text: "默认地址",
+                    dataIndex: "ca_default",
+                    width: 110,
+                    xtype: 'yncolumn'
+                }, {
+                    dataIndex: "ca_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ca_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ca_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ca_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ca_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "默认地址", 
-                        dataIndex : "ca_default", 
-                        width:110,
-                        xtype:'yncolumn'
-                    }]
+                }]
+            }, {
+                xtype: "textfield",
+                name: "cu_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "cu_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "cu_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "cu_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "cu_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
         });
         this.callParent(arguments);

+ 2 - 3
frontend/saas-web/app/view/document/employee/DataList.js

@@ -72,9 +72,8 @@ Ext.define('saas.view.document.employee.DataList', {
                                 grid.store.load();
                             }
                         })
-                        .catch(function(res) {
-                            console.error(res);
-                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        .catch(function(e) {
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
                         });
                     }
                 }]

+ 2 - 3
frontend/saas-web/app/view/document/employee/Window.js

@@ -55,9 +55,8 @@ Ext.define('saas.view.document.employee.Window', {
                             grid.store.load();
                         }
                     })
-                    .catch(function(res) {
-                        console.error(res);
-                        saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                    .catch(function(e) {
+                        saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
                     });
                 }
             }]

+ 4 - 5
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -51,8 +51,8 @@ Ext.define('saas.view.document.kind.ChildForm', {
                     }else {
                         saas.util.BaseUtil.showErrorToast(res.message);
                     }
-                }).catch(function(res) {
-                    saas.util.BaseUtil.showErrorToast(res.message);
+                }).catch(function(e) {
+                    saas.util.BaseUtil.showErrorToast(e.message);
                     w.setLoading(false);
                 })
               }
@@ -251,10 +251,9 @@ Ext.define('saas.view.document.kind.ChildForm', {
                 form.ownerCt.close();
             }
         })
-        .catch(function(res) {
+        .catch(function(e) {
             me.setLoading(false);
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
+            saas.util.BaseUtil.showErrorToast('保存失败: ' + e.message);
         });
     },
     onCancel:function(){

+ 2 - 3
frontend/saas-web/app/view/document/kind/KindController.js

@@ -90,9 +90,8 @@ Ext.define('saas.view.document.kind.KindController', {
                         grid.store.load();
                     }
                 })
-                .catch(function(res) {
-                    console.error(res);
-                    saas.util.BaseUtil.showErrorToast('删除失败: ' + res.message);
+                .catch(function(e) {
+                    saas.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                 });
             }
         });

+ 140 - 133
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -5,142 +5,149 @@ Ext.define('saas.view.document.product.BasePanel', {
     controller: 'document-product-basepanel',
     viewModel: 'document-product-basepanel',
 
+    viewName: 'document-product-basepanel',
+
     deleteMoreMsg: '删除的物料将不能恢复,请确认是否删除?',
     deleteOneMsg: '删除的物料将不能恢复,请确认是否删除?',
 
-    searchField:[{
-        xtype : "textfield", 
-        name : "pr_code", 
-        width:300, 
-        emptyText:'输入物料编号、名称、型号或品牌',
-        getCondition: function (v) {
-            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
-        },
-    },{
-        editable:true,
-        hiddenBtn:true,
-        xtype : "remotecombo", 
-        storeUrl: '/api/document/producttype/getCombo',
-        name : "pr_kind", 
-        fieldLabel : '物料类型',
-        emptyText: '全部',
-    }, {
-        xtype: 'combobox',
-        name: 'pr_statuscode',
-        queryMode: 'local',
-        displayField: 'pr_status',
-        valueField: 'pr_statuscode',
-        fieldLabel : '状态',
-        emptyText: '全部',
-        editable:false,
-        defaultValue:'ENABLE',
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['pr_statuscode', 'pr_status'],
-        data: [
-            ["ALL", "全部"],
-            ["ENABLE", "已启用"],
-            ["BANNED", "已禁用"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL' || !value) {
-                return '1=1';
-            }else {
-                return 'pr_statuscode=\'' + value + '\'';
-            }
-        }
-    }],
-
-    //字段属性
-    caller:'Product',
-    _formXtype:'document-product-formpanel',
-    _title:'物料资料',
-    _deleteUrl:'/api/document/product/delete',
-    _batchOpenUrl:'/api/document/product/batchOpen',
-    _batchCloseUrl:'/api/document/product/batchClose',
-    _batchDeleteUrl:'/api/document/product/batchDelete',
-
-    gridConfig: {
-        idField: 'id',
-        codeField: 'pr_code',
-        statusCodeField:'pr_statuscode',
-        dataUrl: '/api/document/product/list',
-        caller: 'Product',
-        columns : [{
-            text : "id", 
-            width : 0, 
-            dataIndex : "id", 
-            xtype : "numbercolumn", 
-        },{
-            text : "物料编号", 
-            dataIndex : "pr_code", 
-            width : 150.0
-        },{
-            text : "品牌", 
-            dataIndex : "pr_brand", 
-            width : 100.0
-        }, {
-            text : "物料名称", 
-            dataIndex : "pr_detail", 
-            width : 150.0
-        }, {
-            text : "型号", 
-            dataIndex : "pr_orispeccode", 
-            width : 200.0
-        }, {
-            text : "规格", 
-            dataIndex : "pr_spec", 
-            width : 200.0
-        }, {
-            text : "物料类型", 
-            dataIndex : "pr_kind", 
-            width:100
-        }, {
-            text : "库存", 
-            dataIndex : "po_onhand",
-            xtype: 'numbercolumn',
-            width : 100.0,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            }
-        }, {
-            text : "单位", 
-            dataIndex : "pr_unit", 
-            width : 65.0 
-        }, {
-            text : "标准定价(元)", 
-            dataIndex : "pr_standardprice",
-            xtype: 'numbercolumn',
-            width : 110.0,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            }
-        },  {
-            text : "最新购价(元)", 
-            dataIndex : "pr_purcprice",
-            xtype: 'numbercolumn',
-            width : 110.0,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            }
-        }, {
-            text : "最新售价(元)", 
-            dataIndex : "pr_saleprice",
-            xtype: 'numbercolumn',
-            width : 110.0,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            }
-        }, {
-            text : "备注", 
-            dataIndex : "pr_text1",
-            width :250.0
-        }, {
-            text : "状态", 
-            dataIndex : "pr_status",
-            align:'center',
-            width : 80.0
-        }]
+    initComponent: function() {
+        Ext.apply(this, {
+            searchField:[{
+                xtype : "textfield", 
+                name : "pr_code", 
+                width:300, 
+                emptyText:'输入物料编号、名称、型号或品牌',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
+                },
+            },{
+                editable:true,
+                hiddenBtn:true,
+                xtype : "remotecombo", 
+                storeUrl: '/api/document/producttype/getCombo',
+                name : "pr_kind", 
+                fieldLabel : '物料类型',
+                emptyText: '全部',
+            }, {
+                xtype: 'combobox',
+                name: 'pr_statuscode',
+                queryMode: 'local',
+                displayField: 'pr_status',
+                valueField: 'pr_statuscode',
+                fieldLabel : '状态',
+                emptyText: '全部',
+                editable:false,
+                defaultValue:'ENABLE',
+                store: Ext.create('Ext.data.ArrayStore', {
+                fields: ['pr_statuscode', 'pr_status'],
+                data: [
+                    ["ALL", "全部"],
+                    ["ENABLE", "已启用"],
+                    ["BANNED", "已禁用"]
+                ]
+                }),
+                getCondition: function(value) {
+                    if(value == 'ALL' || !value) {
+                        return '1=1';
+                    }else {
+                        return 'pr_statuscode=\'' + value + '\'';
+                    }
+                }
+            }],
+        
+            //字段属性
+            caller:'Product',
+            _formXtype:'document-product-formpanel',
+            _title:'物料资料',
+            _deleteUrl:'/api/document/product/delete',
+            _batchOpenUrl:'/api/document/product/batchOpen',
+            _batchCloseUrl:'/api/document/product/batchClose',
+            _batchDeleteUrl:'/api/document/product/batchDelete',
+        
+            gridConfig: {
+                idField: 'id',
+                codeField: 'pr_code',
+                statusCodeField:'pr_statuscode',
+                dataUrl: '/api/document/product/list',
+                caller: 'Product',
+                columns : [{
+                    text : "id", 
+                    width : 0, 
+                    dataIndex : "id", 
+                    xtype : "numbercolumn", 
+                },{
+                    text : "物料编号", 
+                    dataIndex : "pr_code", 
+                    width : 150.0
+                },{
+                    text : "品牌", 
+                    dataIndex : "pr_brand", 
+                    width : 100.0
+                }, {
+                    text : "物料名称", 
+                    dataIndex : "pr_detail", 
+                    width : 150.0
+                }, {
+                    text : "型号", 
+                    dataIndex : "pr_orispeccode", 
+                    width : 200.0
+                }, {
+                    text : "规格", 
+                    dataIndex : "pr_spec", 
+                    width : 200.0
+                }, {
+                    text : "物料类型", 
+                    dataIndex : "pr_kind", 
+                    width:100
+                }, {
+                    text : "库存", 
+                    dataIndex : "po_onhand",
+                    xtype: 'numbercolumn',
+                    width : 100.0,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text : "单位", 
+                    dataIndex : "pr_unit", 
+                    width : 65.0 
+                }, {
+                    text : "标准定价(元)", 
+                    dataIndex : "pr_standardprice",
+                    xtype: 'numbercolumn',
+                    width : 110.0,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                },  {
+                    text : "最新购价(元)", 
+                    dataIndex : "pr_purcprice",
+                    xtype: 'numbercolumn',
+                    width : 110.0,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                }, {
+                    text : "最新售价(元)", 
+                    dataIndex : "pr_saleprice",
+                    xtype: 'numbercolumn',
+                    width : 110.0,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                }, {
+                    text : "备注", 
+                    dataIndex : "pr_text1",
+                    width :250.0
+                }, {
+                    text : "状态", 
+                    dataIndex : "pr_status",
+                    align:'center',
+                    width : 80.0
+                }]
+            },
+        });
+        this.callParent(arguments);
     },
 
     refresh:function(){

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

@@ -127,9 +127,8 @@ Ext.define('saas.view.document.product.FormController', {
                 saas.util.BaseUtil.showSuccessToast('启用成功');
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('启用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('启用失败: ' + e.message);
         });
     },
     unAudit: function() {
@@ -150,9 +149,8 @@ Ext.define('saas.view.document.product.FormController', {
                 saas.util.BaseUtil.showSuccessToast('禁用成功');
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('禁用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('禁用失败: ' + e.message);
         });
     },
 

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

@@ -4,25 +4,26 @@ Ext.define('saas.view.document.product.FormPanel', {
 
     controller: 'document-product-formpanel',
     viewModel: 'document-product-formpanel',
-    
-    caller:'Product',
+
+    viewName: 'document-product-formpanel',
+    caller: 'Product',
 
     //字段属性
-    _title:'物料资料',
+    _title: '物料资料',
     _idField: 'id',
     _codeField: 'pr_code',
     _statusField: 'pr_status',
     _statusCodeField: 'pr_statuscode',
-    _readUrl:'/api/document/product/read',
-    _saveUrl:'/api/document/product/save',
-    _openUrl:'/api/document/product/open',
-    _closeUrl:'/api/document/product/close',
-    _deleteUrl:'/api/document/product/delete',
-    initId:0,
+    _readUrl: '/api/document/product/read',
+    _saveUrl: '/api/document/product/save',
+    _openUrl: '/api/document/product/open',
+    _closeUrl: '/api/document/product/close',
+    _deleteUrl: '/api/document/product/delete',
+    initId: 0,
 
     codeInHeader: false,
 
-    defaultButtons:[{
+    defaultButtons: [{
         cls: 'x-formpanel-btn-blue',
         xtype: 'button',
         text: '新增',
@@ -62,106 +63,106 @@ Ext.define('saas.view.document.product.FormPanel', {
                 fieldLabel: 'id',
                 allowBlank: true,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_code',
                 fieldLabel: '物料编号',
                 allowBlank: false,
                 group: '基础信息',
-            },{
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/productbrand/getCombo',
-                name : "pr_brand", 
-                fieldLabel : "品牌",
+            }, {
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/productbrand/getCombo',
+                name: "pr_brand",
+                fieldLabel: "品牌",
                 group: '基础信息',
-                addHandler:function(b){
+                addHandler: function (b) {
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.add({
                         xtype: 'document-productbrand-window',
                         bind: {
                             title: '新增物料品牌'
                         },
-                        dataKind:'productbrand',
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        dataKind: 'productbrand',
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
                 }
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_detail',
                 fieldLabel: '物料名称',
                 allowBlank: false,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 'pr_status',
                 fieldLabel: '状态',
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 'pr_statuscode',
                 fieldLabel: '状态码',
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_orispeccode',
                 fieldLabel: '型号',
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'pr_spec',
                 fieldLabel: '规格',
                 //allowBlank: false,
                 group: '基础信息',
-            },{
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/producttype/getCombo',
-                name : "pr_kind", 
-                fieldLabel : "类型",
-                allowBlank : false,
+            }, {
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/producttype/getCombo',
+                name: "pr_kind",
+                fieldLabel: "类型",
+                allowBlank: false,
                 group: '基础信息',
-                addHandler:function(b){
-                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                addHandler: function (b) {
+                    var document = Ext.create('saas.view.document.kind.Kind', {});
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.getController().getView().add({
                         xtype: 'document-kind-childwin',
                         bind: {
                             title: '新增物料类型'
                         },
-                        dataKind:'productkind',
-                        belong:document.etc['productkind'],
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        dataKind: 'productkind',
+                        belong: document.etc['productkind'],
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
                 }
-            },{  
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/productunit/getCombo',
-                name : "pr_unit", 
-                fieldLabel : "单位", 
-                allowBlank : false, 
-                editable:false,
+            }, {
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/productunit/getCombo',
+                name: "pr_unit",
+                fieldLabel: "单位",
+                allowBlank: false,
+                editable: false,
                 group: '基础信息',
-                addHandler:function(b){
+                addHandler: function (b) {
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.add({
                         xtype: 'document-productunit-window',
                         bind: {
                             title: '新增计量单位'
                         },
-                        dataKind:'productunit',
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        dataKind: 'productunit',
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
@@ -173,99 +174,99 @@ Ext.define('saas.view.document.product.FormPanel', {
                 minValue: 0,
                 maxLength: 10,
                 group: '管理信息',
-            },{
-                xtype : "numberfield", 
-                name : "pr_zxbzs", 
-                fieldLabel : "最小包装数", 
-                minValue:0,
+            }, {
+                xtype: "numberfield",
+                name: "pr_zxbzs",
+                fieldLabel: "最小包装数",
+                minValue: 0,
                 decimalPrecision: 0,
-                allowBlank : true,
+                allowBlank: true,
                 group: '管理信息',
-            },{
-                xtype : "hidden", 
-                name : "pr_vendid", 
-                fieldLabel : "供应商ID",
+            }, {
+                xtype: "hidden",
+                name: "pr_vendid",
+                fieldLabel: "供应商ID",
                 group: '管理信息',
-            },{
-                xtype : "hidden",   
-                name : "pr_vendcode", 
-                fieldLabel : "供应商编号",
+            }, {
+                xtype: "hidden",
+                name: "pr_vendcode",
+                fieldLabel: "供应商编号",
                 group: '管理信息',
             }, {
-                xtype : "vendorDbfindTrigger", 
-                name : "pr_vendname", 
-                fieldLabel : "供应商名称",
+                xtype: "vendorDbfindTrigger",
+                name: "pr_vendname",
+                fieldLabel: "供应商名称",
                 columnWidth: 0.5,
                 group: '管理信息',
-            },{
-                xtype : "hidden", 
-                name : "pr_whid", 
-                fieldLabel : "仓库ID",
+            }, {
+                xtype: "hidden",
+                name: "pr_whid",
+                fieldLabel: "仓库ID",
                 group: '管理信息',
-            },{  
-                xtype : "hidden",     
-                name : "pr_whcode", 
-                fieldLabel : "仓库编号",
+            }, {
+                xtype: "hidden",
+                name: "pr_whcode",
+                fieldLabel: "仓库编号",
                 group: '管理信息',
             }, {
-                xtype : "warehouseDbfindTrigger", 
-                name : "pr_whname", 
-                fieldLabel : "仓库", 
+                xtype: "warehouseDbfindTrigger",
+                name: "pr_whname",
+                fieldLabel: "仓库",
                 columnWidth: 0.25,
                 group: '管理信息',
-            },{
-                xtype : "numberfield", 
-                name : "pr_standardprice", 
-                fieldLabel : "标准定价(元)", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "numberfield",
+                name: "pr_standardprice",
+                fieldLabel: "标准定价(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 4,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '管理信息',
-            },{
-                ignore:true,
-                readOnly:true,
-                xtype : "numberfield", 
-                name : "pr_purcprice", 
-                fieldLabel : "最新购价(元)", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                ignore: true,
+                readOnly: true,
+                xtype: "numberfield",
+                name: "pr_purcprice",
+                fieldLabel: "最新购价(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 4,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '管理信息',
-            },{
-                ignore:true,
-                readOnly:true,
-                xtype : "numberfield", 
-                name : "pr_saleprice", 
-                fieldLabel : "最新售价(元)", 
+            }, {
+                ignore: true,
+                readOnly: true,
+                xtype: "numberfield",
+                name: "pr_saleprice",
+                fieldLabel: "最新售价(元)",
                 decimalPrecision: 4,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '管理信息',
-            },{  
-                hidden:true,
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "创建时间"
-            },{  
-                hidden:true,
-                xtype : "datefield", 
-                name : "updateTime", 
-                fieldLabel : "更新时间"
-            },{
-                xtype : "textfield", 
-                name : "pr_text1", 
-                fieldLabel : "备注",
+            }, {
+                hidden: true,
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "创建时间"
+            }, {
+                hidden: true,
+                xtype: "datefield",
+                name: "updateTime",
+                fieldLabel: "更新时间"
+            }, {
+                xtype: "textfield",
+                name: "pr_remark",
+                fieldLabel: "备注",
                 columnWidth: 1
             }, {
                 xtype: 'checkbox',
                 fieldLabel: '期初设置',
                 name: 'qcsz',
                 ignore: true,
-                defaultValue:true,
+                defaultValue: true,
                 bind: {
                     disabled: '{qcsz_disabled}'
                 },
@@ -273,120 +274,189 @@ Ext.define('saas.view.document.product.FormPanel', {
                     change: 'qcsz_change'
                 }
             }, {
-                xtype : "detailGridField", 
-                storeModel:'saas.model.document.ProductDetail',
+                xtype: "detailGridField",
+                name: 'detailGridField',
+                storeModel: 'saas.model.document.ProductDetail',
                 detnoColumn: 'pd_detno',
                 emptyRows: 3,
                 showCount: true,
-                allowEmpty:true,
+                allowEmpty: true,
                 // hidden: true,
-                deleteDetailUrl:'/api/document/product/deleteDetail',
+                deleteDetailUrl: '/api/document/product/deleteDetail',
                 listeners: {
                     datachanged: 'onDataChanged'
                 },
-                columns : [
-                {
-                    text : "ID", 
-                    dataIndex : "id", 
-                    hidden : true,  
-                    xtype : "numbercolumn"
-                },
-                {
-                    text : "物料ID", 
-                    dataIndex : "pd_prodid", 
-                    hidden : true,  
-                    xtype : "numbercolumn"
-                },
-                {
-                    allowBlank:false,
-                    text : "仓库编号", 
-                    dataIndex : "pd_whcode", 
-                    editor : {
-                        xtype : "warehouseDbfindTrigger"
-                    }, 
-                    width : 150
-                },
-                {
-                    allowBlank:true,
-                    readOnly:true,
-                    editable:false,
-                    text : "仓库名称", 
-                    dataIndex : "pd_whname", 
-                    width : 200
-                },{
-                    allowBlank:true,
-                    hidden:true,
-                    text : "仓库ID", 
-                    dataIndex : "pd_whid", 
-                    xtype : "numbercolumn", 
-                },
-                {
-                    text : "期初数量", 
-                    dataIndex : "pd_num", 
+                columns: [{
+                    text: "ID",
+                    dataIndex: "id",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: "物料ID",
+                    dataIndex: "pd_prodid",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    allowBlank: false,
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    editor: {
+                        xtype: "warehouseDbfindTrigger"
+                    },
+                    width: 150
+                }, {
+                    allowBlank: true,
+                    readOnly: true,
+                    editable: false,
+                    text: "仓库名称",
+                    dataIndex: "pd_whname",
+                    width: 200
+                }, {
+                    allowBlank: true,
+                    hidden: true,
+                    text: "仓库ID",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                }, {
+                    text: "期初数量",
+                    dataIndex: "pd_num",
                     // xtype: 'numbercolumn',
                     align: 'end',
-                    width : 110.0,
-                    allowBlank : false,
-                    editor : {
-                        xtype : "numberfield",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
                         decimalPrecision: 3,
-                        minValue:0
+                        minValue: 0
                     },
-                    listeners:{
-                        edit:'amount_change'
+                    listeners: {
+                        edit: 'amount_change'
                     },
-                    renderer : function(v) {
+                    renderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 3, false);
                     },
                     summaryType: 'sum',
-                    summaryRenderer: function(v) {
+                    summaryRenderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 3, false);
                     }
-                },
-                {
-                    text : "单位成本(元)", 
-                    dataIndex : "pd_price", 
+                }, {
+                    text: "单位成本(元)",
+                    dataIndex: "pd_price",
                     // xtype: 'numbercolumn',
                     align: 'end',
-                    width : 110.0,
-                    allowBlank : true,
-                    editor : {
-                        xtype : "numberfield",
+                    width: 110.0,
+                    allowBlank: true,
+                    editor: {
+                        xtype: "numberfield",
                         decimalPrecision: 4,
                         allowDecimals: true,
-                        minValue:0
+                        minValue: 0
                     },
-                    listeners:{
-                        edit:'amount_change'
+                    listeners: {
+                        edit: 'amount_change'
                     },
-                    renderer : function(v) {
+                    renderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 4, true);
                     },
-                },
-                {
-                    text : "期初金额(元)", 
-                    dataIndex : "pd_amount", 
+                }, {
+                    text: "期初金额(元)",
+                    dataIndex: "pd_amount",
                     // xtype: 'numbercolumn',
                     align: 'end',
-                    width : 110.0,
-                    allowBlank : true,
-                    renderer : function(v) {
+                    width: 110.0,
+                    allowBlank: true,
+                    renderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
-                    summaryRenderer: function(v) {
+                    summaryRenderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    dataIndex: "pd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
+            }, {
+                xtype: "textfield",
+                name: "pr_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "pr_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "pr_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "pr_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "pr_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
-        
+
             listeners: {
-                load: function(form, data) {
+                load: function (form, data) {
                     var viewModel = form.getViewModel();
                     var store = viewModel.get('detail0').detailStore,
-                    detailGrid = form.down('grid'),
-                    trueData = detailGrid.getTrueData();
-        
+                        detailGrid = form.down('grid'),
+                        trueData = detailGrid.getTrueData();
+
                     viewModel.set('qcsz', trueData.length > 0);
                     viewModel.set('qcsz_disabled', trueData.length > 0);
                     viewModel.notify();
@@ -397,27 +467,27 @@ Ext.define('saas.view.document.product.FormPanel', {
         this.callParent(arguments);
     },
 
-    beforeSave:function(){
+    beforeSave: function () {
         var me = this,
-        controller = me.getController(),
-        viewModel = me.getViewModel(),
-        store = viewModel.get('detail0').detailStore,
-        items  = store.getData().items,
-        controller = me.getController(),
-        str='';
-        Ext.Array.each(items, function(item, i) {
-            if(!item.get('pd_price')&&item.get('pd_whcode')){     
-                str=str+item.get('pd_detno')+','
-            }             
-         });
-        if(str!=''){
-            saas.util.BaseUtil.showConfirm('提示','行: '+str+'物料单位成本为0,是否继续保存?')
-            .then(function(y) {
-                if(y == 'yes') {
-                    controller.save();
-                }
-            });
-        }else{
+            controller = me.getController(),
+            viewModel = me.getViewModel(),
+            store = viewModel.get('detail0').detailStore,
+            items = store.getData().items,
+            controller = me.getController(),
+            str = '';
+        Ext.Array.each(items, function (item, i) {
+            if (!item.get('pd_price') && item.get('pd_whcode')) {
+                str = str + item.get('pd_detno') + ','
+            }
+        });
+        if (str != '') {
+            saas.util.BaseUtil.showConfirm('提示', '行: ' + str + '物料单位成本为0,是否继续保存?')
+                .then(function (y) {
+                    if (y == 'yes') {
+                        controller.save();
+                    }
+                });
+        } else {
             controller.save();
         }
         return false;

+ 118 - 112
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -4,125 +4,131 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     controller: 'document-vendor-basepanel',
     viewModel: 'document-vendor-basepanel',
 
+    viewName: 'document-vendor-basepanel',
+
     deleteMoreMsg: '删除的供应商资料将不能恢复,请确认是否删除?',
     deleteOneMsg: '删除的供应商资料将不能恢复,请确认是否删除?',
 
-    searchField:[
-    {
-        xtype : "textfield", 
-        name : "ve_code", 
-        width:200, 
-        emptyText:'请输入供应商编号或名称',
-        getCondition: function (v) {
-            return "(upper(CONCAT(ve_code,'#',ve_name)) like '%" + v.toUpperCase() + "%' )";
-        }
-    },{
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/vendorkind/getCombo',
-        name : "ve_type", 
-        fieldLabel : '供应商类型',
-        emptyText: '全部',
-        hiddenBtn:true
-    },{
-        xtype: 'combobox',
-        name: 've_statuscode',
-        queryMode: 'local',
-        displayField: 've_status',
-        valueField: 've_statuscode',
-        fieldLabel : '状态',
-        emptyText: '全部',
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['ve_statuscode', 've_status'],
-        data: [
-            ["ALL", "全部"],
-            ["ENABLE", "已启用"],
-            ["BANNED", "已禁用"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL'||value == null) {
-                return '1=1';
-            }else {
-                return 've_statuscode=\'' + value + '\'';
-            }
-        }
-    }],
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "ve_code",
+                width: 200,
+                emptyText: '请输入供应商编号或名称',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(ve_code,'#',ve_name)) like '%" + v.toUpperCase() + "%' )";
+                }
+            }, {
+                xtype: "remotecombo",
+                storeUrl: '/api/document/vendorkind/getCombo',
+                name: "ve_type",
+                fieldLabel: '供应商类型',
+                emptyText: '全部',
+                hiddenBtn: true
+            }, {
+                xtype: 'combobox',
+                name: 've_statuscode',
+                queryMode: 'local',
+                displayField: 've_status',
+                valueField: 've_statuscode',
+                fieldLabel: '状态',
+                emptyText: '全部',
+                editable: false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['ve_statuscode', 've_status'],
+                    data: [
+                        ["ALL", "全部"],
+                        ["ENABLE", "已启用"],
+                        ["BANNED", "已禁用"]
+                    ]
+                }),
+                getCondition: function (value) {
+                    if (value == 'ALL' || value == null) {
+                        return '1=1';
+                    } else {
+                        return 've_statuscode=\'' + value + '\'';
+                    }
+                }
+            }],
 
-    //字段属性
-    caller:'Vendor',
-    _formXtype:'document-vendor-formpanel',
-    _title:'供应商资料',
-    _deleteUrl:'/api/document/vendor/delete',
-    _batchOpenUrl:'/api/document/vendor/batchOpen',
-    _batchCloseUrl:'/api/document/vendor/batchClose',
-    _batchDeleteUrl:'/api/document/vendor/batchDelete',
+            //字段属性
+            caller: 'Vendor',
+            _formXtype: 'document-vendor-formpanel',
+            _title: '供应商资料',
+            _deleteUrl: '/api/document/vendor/delete',
+            _batchOpenUrl: '/api/document/vendor/batchOpen',
+            _batchCloseUrl: '/api/document/vendor/batchClose',
+            _batchDeleteUrl: '/api/document/vendor/batchDelete',
 
-    gridConfig: {
-        idField: 'id',
-        codeField: 've_code',
-        statusCodeField:'ve_statuscode',
-        dataUrl: '/api/document/vendor/list',
-        caller: 'Vendor',
-        columns : [{
-            text : "供应商id", 
-            width : 0, 
-            dataIndex : "id", 
-            xtype : "numbercolumn", 
-        },{
-            text : "供应商编号", 
-            width : 150.0, 
-            dataIndex : "ve_code" 
-        },{
-            text : "供应商简称", 
-            width : 150.0, 
-            dataIndex : "ve_shortname",
-            hidden: true
-        }, {
-            text : "供应商名称", 
-            dataIndex : "ve_name", 
-            width : 200.0
-        }, {
-            text : "状态", 
-            dataIndex : "ve_status", 
-            align: 'center',
-            width : 80.0
-        }, {
-            text : "类型", 
-            dataIndex : "ve_type", 
-            width : 100.0 
-        }, {
-            text : "税率(%)", 
-            xtype: 'numbercolumn', 
-            dataIndex : "ve_taxrate", 
-            width : 80.0, 
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, false);
-            }
-        }, {
-            text : "结算天数", 
-            xtype: 'numbercolumn',
-            dataIndex : "ve_promisedays", 
-            width : 110.0, 
-            renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            }
-        },{
-            text: '应付余额(元)',
-            xtype: 'numbercolumn',
-            dataIndex : 've_leftamount',
-            width : 120,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text : "备注", 
-            dataIndex : "ve_remark", 
-            width : 250.0
-        }]
+            gridConfig: {
+                idField: 'id',
+                codeField: 've_code',
+                statusCodeField: 've_statuscode',
+                dataUrl: '/api/document/vendor/list',
+                caller: 'Vendor',
+                columns: [{
+                    text: "供应商id",
+                    hidden: true,
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                }, {
+                    text: "供应商编号",
+                    width: 150.0,
+                    dataIndex: "ve_code"
+                }, {
+                    text: "供应商简称",
+                    width: 150.0,
+                    dataIndex: "ve_shortname",
+                    hidden: true
+                }, {
+                    text: "供应商名称",
+                    dataIndex: "ve_name",
+                    width: 200.0
+                }, {
+                    text: "状态",
+                    dataIndex: "ve_status",
+                    align: 'center',
+                    width: 80.0
+                }, {
+                    text: "类型",
+                    dataIndex: "ve_type",
+                    width: 100.0
+                }, {
+                    text: "税率(%)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "ve_taxrate",
+                    width: 80.0,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                }, {
+                    text: "结算天数",
+                    xtype: 'numbercolumn',
+                    dataIndex: "ve_promisedays",
+                    width: 110.0,
+                    renderer: function (v) {
+                        return Ext.util.Format.number(v, '0');
+                    }
+                }, {
+                    text: '应付余额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 've_leftamount',
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "ve_remark",
+                    width: 250.0
+                }]
+            },
+        });
+        this.callParent(arguments);
     },
 
-    refresh:function(){
+    refresh: function () {
         this.items.items[0].store.load()
     }
 });

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

@@ -50,9 +50,8 @@ Ext.define('saas.view.document.vendor.FormController', {
                 saas.util.BaseUtil.showSuccessToast('启用成功');
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('启用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('启用失败: ' + e.message);
         });
     },
     unAudit: function() {
@@ -73,9 +72,8 @@ Ext.define('saas.view.document.vendor.FormController', {
                 saas.util.BaseUtil.showSuccessToast('禁用成功');
             }
         })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('禁用失败: ' + res.message);
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('禁用失败: ' + e.message);
         });
     }
 });

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

@@ -4,25 +4,26 @@ Ext.define('saas.view.document.vendor.FormPanel', {
 
     controller: 'document-vendor-formpanel',
     viewModel: 'document-vendor-formpanel',
-    
-    caller:'Vendor',
+
+    viewName: 'document-vendor-formpanel',
+    caller: 'Vendor',
 
     //字段属性
-    _title:'供应商资料',
+    _title: '供应商资料',
     _idField: 'id',
     _codeField: 've_code',
     _statusField: 've_status',
     _statusCodeField: 've_statuscode',
-    _readUrl:'/api/document/vendor/read',
-    _saveUrl:'/api/document/vendor/save',
-    _openUrl:'/api/document/vendor/open',
-    _closeUrl:'/api/document/vendor/close',
-    _deleteUrl:'/api/document/vendor/delete',
-    initId:0,
+    _readUrl: '/api/document/vendor/read',
+    _saveUrl: '/api/document/vendor/save',
+    _openUrl: '/api/document/vendor/open',
+    _closeUrl: '/api/document/vendor/close',
+    _deleteUrl: '/api/document/vendor/delete',
+    initId: 0,
 
     codeInHeader: false,
 
-    defaultButtons:[{
+    defaultButtons: [{
         cls: 'x-formpanel-btn-blue',
         xtype: 'button',
         text: '新增',
@@ -54,7 +55,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         unAuditBtnText: '启用',
     },
 
-    initComponent: function() {
+    initComponent: function () {
         Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
@@ -63,267 +64,335 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 allowBlank: true,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 've_code',
                 fieldLabel: '供应商编号',
                 allowBlank: false,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 've_name',
                 fieldLabel: '供应商名称',
                 allowBlank: false,
                 columnWidth: 0.25,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 've_shortname',
                 fieldLabel: '供应商简称',
                 columnWidth: 0.25,
                 hidden: true,
                 group: '基础信息',
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 've_status',
                 fieldLabel: '状态',
                 allowBlank: true,
                 columnWidth: 0.25
-            },{
+            }, {
                 xtype: 'hidden',
                 name: 've_statuscode',
                 fieldLabel: '状态码',
                 allowBlank: true,
                 columnWidth: 0.25
-            },{
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/vendorkind/getCombo',
-                name : "ve_type", 
-                fieldLabel : "供应商类型", 
-                columnWidth : 0.25,
+            }, {
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/vendorkind/getCombo',
+                name: "ve_type",
+                fieldLabel: "供应商类型",
+                columnWidth: 0.25,
                 group: '基础信息',
-                addHandler:function(b){
-                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                addHandler: function (b) {
+                    var document = Ext.create('saas.view.document.kind.Kind', {});
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.getController().getView().add({
                         xtype: 'document-kind-childwin',
                         bind: {
                             title: '新增供应商类型'
                         },
-                        dataKind:'vendorkind',
-                        belong:document.etc['vendorkind'],
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        dataKind: 'vendorkind',
+                        belong: document.etc['vendorkind'],
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
                 }
-            },{
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "创建时间", 
-                allowBlank : true, 
-                hidden:true,
-                columnWidth : 0
-            },{
-                xtype : "datefield", 
-                name : "ve_begindate", 
-                format:'Y-m-d',
-                fieldLabel : "期初日期", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "创建时间",
+                allowBlank: true,
+                hidden: true,
+                columnWidth: 0
+            }, {
+                xtype: "datefield",
+                name: "ve_begindate",
+                format: 'Y-m-d',
+                fieldLabel: "期初日期",
+                allowBlank: true,
+                columnWidth: 0.25,
                 group: '交易信息',
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "ve_beginapamount", 
-                fieldLabel : "期初应付(元)",
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "ve_beginapamount",
+                fieldLabel: "期初应付(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true, 
-                name : "ve_beginprepayamount", 
-                fieldLabel : "期初预付(元)", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "ve_beginprepayamount",
+                fieldLabel: "期初预付(元)",
+                allowBlank: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
-                minValue:0,
+                minValue: 0,
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },    
-            },{  
-                xtype : "numberfield", 
-                name : "ve_leftamount", 
-                fieldLabel : "应付余额(元)", 
-                allowBlank : true, 
-                readOnly:true,
-                ignore:true,
-                columnWidth : 0.25,
+                },
+            }, {
+                xtype: "numberfield",
+                name: "ve_leftamount",
+                fieldLabel: "应付余额(元)",
+                allowBlank: true,
+                readOnly: true,
+                ignore: true,
+                columnWidth: 0.25,
                 decimalPrecision: 2,
                 thousandSeparator: ',',
                 group: '交易信息',
-                renderer : function(v) {
+                renderer: function (v) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },  
-            },{
-                xtype : "numberfield", 
-                name : "ve_taxrate", 
-                hideTrigger:true,
-                fieldLabel : "税率(%)", 
-                allowBlank : false, 
-                columnWidth : 0.25,
-                minValue:0,  
-                maxValue:100,
+                },
+            }, {
+                xtype: "numberfield",
+                name: "ve_taxrate",
+                hideTrigger: true,
+                fieldLabel: "税率(%)",
+                allowBlank: false,
+                columnWidth: 0.25,
+                minValue: 0,
+                maxValue: 100,
                 group: '交易信息',
-            },{ 
-                xtype : "numberfield", 
-                hideTrigger:true,
-                name : "ve_promisedays", 
-                fieldLabel : "结算天数", 
-                allowBlank : true, 
-                columnWidth : 0.25,
-                minValue:0,
+            }, {
+                xtype: "numberfield",
+                hideTrigger: true,
+                name: "ve_promisedays",
+                fieldLabel: "结算天数",
+                allowBlank: true,
+                columnWidth: 0.25,
+                minValue: 0,
                 maxLength: 8,
                 enforceMaxLength: true,
                 decimalPrecision: 0,
                 group: '交易信息',
-            },{
-                xtype : "textfield", 
-                name : "ve_nsrzh", 
-                fieldLabel : "纳税人识别号", 
-                allowBlank : true, 
-                columnWidth : 0.25,
+            }, {
+                xtype: "textfield",
+                name: "ve_nsrzh",
+                fieldLabel: "纳税人识别号",
+                allowBlank: true,
+                columnWidth: 0.25,
                 group: '基础信息',
-            },{
-                xtype : "textfield", 
-                name : "ve_bankcode", 
-                fieldLabel : "开户银行", 
-                allowBlank : true, 
-                columnWidth : 0.25
-            },{
-                xtype : "textfield", 
-                name : "ve_bankaccount", 
-                fieldLabel : "银行账户", 
-                allowBlank : true, 
-                columnWidth : 0.25
-            },{
-                xtype:'hidden',
-                name : "ve_uu", 
-                fieldLabel : "供应商UU", 
-                allowBlank : true, 
-                editable:false,
-                readOnly:true,
-                columnWidth : 0.25
-            },{  
-                xtype : "datefield", 
-                name : "updateTime", 
-                fieldLabel : "更新时间", 
-                allowBlank : true, 
-                hidden:true,
-                columnWidth : 0.25  
             }, {
-                xtype : "hidden", 
-                name : "ve_buyercode", 
-                fieldLabel : "采购员编号"
-            },{
-                xtype : "employeeDbfindTrigger", 
-                name : "ve_buyername", 
-                fieldLabel : "采购员",
-                columnWidth : 0.25,
-                defaultValue:saas.util.BaseUtil.getCurrentUser().realname
-            },{
-                xtype : "hidden", 
-                name : "ve_buyerid", 
-                fieldLabel : "采购员ID",
-                defaultValue:saas.util.BaseUtil.getCurrentUser().id
-            },{
-                xtype : "textfield", 
-                name : "ve_address", 
-                fieldLabel : "公司地址", 
-                allowBlank : true, 
-                columnWidth : 0.75
-            },{
-                fieldLabel : "备注", 
-                xtype:'textfield',
-                name : "ve_remark",
-                columnWidth : 1
+                xtype: "textfield",
+                name: "ve_bankcode",
+                fieldLabel: "开户银行",
+                allowBlank: true,
+                columnWidth: 0.25
             }, {
-                xtype : "detailGridField", 
-                storeModel:'saas.model.document.vendorcontact',
+                xtype: "textfield",
+                name: "ve_bankaccount",
+                fieldLabel: "银行账户",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: 'hidden',
+                name: "ve_uu",
+                fieldLabel: "供应商UU",
+                allowBlank: true,
+                editable: false,
+                readOnly: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "datefield",
+                name: "updateTime",
+                fieldLabel: "更新时间",
+                allowBlank: true,
+                hidden: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "ve_buyercode",
+                fieldLabel: "采购员编号"
+            }, {
+                xtype: "employeeDbfindTrigger",
+                name: "ve_buyername",
+                fieldLabel: "采购员",
+                columnWidth: 0.25,
+                defaultValue: saas.util.BaseUtil.getCurrentUser().realname
+            }, {
+                xtype: "hidden",
+                name: "ve_buyerid",
+                fieldLabel: "采购员ID",
+                defaultValue: saas.util.BaseUtil.getCurrentUser().id
+            }, {
+                xtype: "textfield",
+                name: "ve_address",
+                fieldLabel: "公司地址",
+                allowBlank: true,
+                columnWidth: 0.75
+            }, {
+                fieldLabel: "备注",
+                xtype: 'textfield',
+                name: "ve_remark",
+                columnWidth: 1
+            }, {
+                xtype: "detailGridField",
+                name: 'detailGridField',
+                storeModel: 'saas.model.document.vendorcontact',
                 detnoColumn: 'vc_detno',
                 showCount: false,
-                deleteDetailUrl:'/api/document/vendor/deleteContact',
-                columns : [
-                    {
-                        text : "ID", 
-                        dataIndex : "id", 
-                        hidden : true, 
-                        xtype : "numbercolumn"
+                deleteDetailUrl: '/api/document/vendor/deleteContact',
+                columns: [{
+                    text: "ID",
+                    dataIndex: "id",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: "关联ID",
+                    dataIndex: "vc_veid",
+                    hidden: true,
+                    xtype: "numbercolumn"
+                }, {
+                    allowBlank: false,
+                    text: "联系人",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "关联ID", 
-                        dataIndex : "vc_veid", 
-                        hidden : true, 
-                        xtype : "numbercolumn"
+                    dataIndex: "vc_name",
+                    width: 110
+                }, {
+                    allowBlank: false,
+                    text: "电话",
+                    editor: {
+                        // regex:/^[\d | -]*$/,
+                        // regexText:'请输入正确的手机号码',
+                        hideTrigger: true,
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:false,
-                        text : "联系人", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "vc_name", 
-                        width:110
+                    dataIndex: "vc_tel",
+                    width: 200
+                }, {
+                    allowBlank: true,
+                    text: "微信/QQ",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:false,
-                        text : "电话", 
-                        editor : {
-                            // regex:/^[\d | -]*$/,
-                            // regexText:'请输入正确的手机号码',
-                            hideTrigger:true,
-                            xtype : "textfield"
-                        },
-                        dataIndex : "vc_tel", 
-                        width:200 
+                    dataIndex: "vc_qq",
+                    width: 110
+                }, {
+                    text: "邮箱",
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        allowBlank:true,
-                        text : "微信/QQ", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "vc_qq", 
-                        width:110
+                    dataIndex: "vc_email",
+                    width: 180
+                }, {
+                    text: "默认联系人",
+                    dataIndex: "vc_default",
+                    xtype: "yncolumn",
+                }, {
+                    dataIndex: "vc_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "邮箱", 
-                        editor : {
-                            xtype : "textfield"
-                        },
-                        dataIndex : "vc_email", 
-                        width:180
+                }, {
+                    dataIndex: "vc_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
                     },
-                    {
-                        text : "默认联系人", 
-                        dataIndex : "vc_default", 
-                        xtype : "yncolumn",
-                    }]
-                }
-            ],
+                }, {
+                    dataIndex: "vc_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "vc_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "vc_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: "textfield",
+                name: "ve_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ve_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ve_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ve_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ve_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
+            }],
         });
         this.callParent(arguments);
     },

+ 2 - 3
frontend/saas-web/app/view/document/warehouse/DataList.js

@@ -72,9 +72,8 @@ Ext.define('saas.view.document.warehouse.DataList', {
                                 grid.store.load();
                             }
                         })
-                        .catch(function(res) {
-                            console.error(res);
-                            saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                        .catch(function(e) {
+                            saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
                         });
                     }
                 }]

+ 2 - 3
frontend/saas-web/app/view/document/warehouse/Window.js

@@ -55,9 +55,8 @@ Ext.define('saas.view.document.warehouse.Window', {
                             grid.store.load();
                         }
                     })
-                    .catch(function(res) {
-                        console.error(res);
-                        saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                    .catch(function(e) {
+                        saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
                     });
                 }
             }]

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

@@ -84,8 +84,8 @@ Ext.define('saas.view.home.Home', {
             if(!res.data.begin){
                 saas.util.BaseUtil.openTab('sys-guide-formpanel', '新手导航', 'sys-guide-formpanel')
             }
-        }).catch(function(res) {
-            saas.util.BaseUtil.showErrorToast(res.message);
+        }).catch(function(e) {
+            saas.util.BaseUtil.showErrorToast(e.message);
         })
         this.callParent(arguments);
     },

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

@@ -147,9 +147,9 @@ Ext.define('saas.view.home.HomeModel', {
                     }
                 }
             },
-            sorters: [
-                { property: 'x', direction: 'ASC' }
-            ],
+            // sorters: [
+            //     { property: 'x', direction: 'ASC' }
+            // ],
             listeners: {
                 beforeload: function() {
                     var p = Ext.getCmp('sale_trend');
@@ -184,9 +184,9 @@ Ext.define('saas.view.home.HomeModel', {
                     }
                 }
             },
-            sorters: [
-                { property: 'x', direction: 'ASC' }
-            ],
+            // sorters: [
+            //     { property: 'x', direction: 'ASC' }
+            // ],
             listeners: {
                 beforeload: function() {
                     var p = Ext.getCmp('stock_amount');

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

@@ -25,7 +25,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
     initId: 0,
 
     initComponent: function () {
-        Ext.applyIf(this, {
+        Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
@@ -189,6 +189,51 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                     editor: {
                         xtype: ""
                     }
+                }, {
+                    dataIndex: "ftd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ftd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ftd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ftd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ftd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: "textfield",
@@ -238,6 +283,36 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 name: "ft_auditdate",
                 fieldLabel: "审核日期",
                 readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "ft_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ft_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ft_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ft_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "ft_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }]
         });
         this.callParent(arguments);

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

@@ -6,124 +6,130 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
     viewModel: 'money-fundtransfer-querypanel',
 
     viewName: 'money-fundtransfer-querypanel',
-    
-    queryFormItems: [{
-        xtype: 'textfield',
-        name:'ft_code',
-        emptyText:'请输入单号',
-    }, {
-        xtype : "bandinfoDbfindTrigger",
-        name : "ftd_bankname",
-        margin:'0 0 0 20',
-        emptyText: '请输入转出账户编号或名称',
-    }, {
-        xtype : "condatefield",
-        name : "ft_date",
-        fieldLabel : "日期",
-        columnWidth: 0.5
-    }, {
-        xtype : "bandinfoDbfindTrigger",
-        name : "ftd_inbankname",
-        fieldLabel : "转入账户",
-        emptyText: '请输入转入账户编号或名称',
-    },{
-        xtype: 'combobox',
-        name: 'ft_statuscode',
-        fieldLabel: '单据状态',
-        queryMode: 'local',
-        displayField: 'ft_status',
-        valueField: 'ft_statuscode',
-        emptyText :'全部',
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['ft_statuscode', 'ft_status'],
-        data: [
-            ["ALL", "全部"],
-            ["AUDITED", "已审核"],
-            ["UNAUDITED", "未审核"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
-                return 'ft_statuscode=\'' + value + '\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'creatorName',
-        fieldLabel: '录入人',
-        emptyText:'请输入账户名称或姓名',
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'fundtransfer.creatorName like\'%' + value + '%\'';
+
+    initComponent: function () {
+        Ext.apply(this, {
+            queryFormItems: [{
+                xtype: 'textfield',
+                name: 'ft_code',
+                emptyText: '请输入单号',
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "ftd_bankname",
+                margin: '0 0 0 20',
+                emptyText: '请输入转出账户编号或名称',
+            }, {
+                xtype: "condatefield",
+                name: "ft_date",
+                fieldLabel: "日期",
+                columnWidth: 0.5
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "ftd_inbankname",
+                fieldLabel: "转入账户",
+                emptyText: '请输入转入账户编号或名称',
+            }, {
+                xtype: 'combobox',
+                name: 'ft_statuscode',
+                fieldLabel: '单据状态',
+                queryMode: 'local',
+                displayField: 'ft_status',
+                valueField: 'ft_statuscode',
+                emptyText: '全部',
+                editable: false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['ft_statuscode', 'ft_status'],
+                    data: [
+                        ["ALL", "全部"],
+                        ["AUDITED", "已审核"],
+                        ["UNAUDITED", "未审核"]
+                    ]
+                }),
+                getCondition: function (value) {
+                    if (value == 'ALL') {
+                        return '1=1';
+                    } else {
+                        return 'ft_statuscode=\'' + value + '\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'creatorName',
+                fieldLabel: '录入人',
+                emptyText: '请输入账户名称或姓名',
+                getCondition: function (value) {
+                    if (!value) {
+                        return '1=1';
+                    } else {
+                        return 'fundtransfer.creatorName like\'%' + value + '%\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'ft_auditman',
+                fieldLabel: '审核人',
+                emptyText: '请输入账户名称或姓名'
+            }],
+            moreQueryFormItems: [],
+            queryGridConfig: {
+                idField: 'id',
+                codeField: 'ft_code',
+                addTitle: '资金转存',
+                addXtype: 'money-fundtransfer-formpanel',
+                defaultCondition: '',
+                baseVastUrl: '/api/money/fundtransfer/',
+                caller: 'FundTransfer',
+                baseColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '单据编号',
+                    dataIndex: 'ft_code',
+                    width: 150
+                }, {
+                    text: '日期',
+                    dataIndex: 'ft_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '转出账户',
+                    dataIndex: 'ftd_bankname',
+                    width: 150
+                }, {
+                    text: '转入账户',
+                    dataIndex: 'ftd_inbankname',
+                    width: 150
+                }, {
+                    text: '金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'ftd_nowbalance',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                }, {
+                    text: '结算方式',
+                    dataIndex: 'ftd_paymethod',
+                    width: 150
+                }, {
+                    text: '结算号',
+                    dataIndex: 'ftd_paycode',
+                    hidden: true
+                }, {
+                    text: '审核状态',
+                    dataIndex: 'ft_status',
+                    align: 'center',
+                    width: 80
+                }, {
+                    text: '备注',
+                    dataIndex: 'ftd_remark',
+                    width: 250
+                }],
+                relativeColumn: []
             }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'ft_auditman',
-        fieldLabel: '审核人',
-        emptyText:'请输入账户名称或姓名'
-    }],
-    moreQueryFormItems: [],
-    queryGridConfig: {
-        idField: 'id',
-        codeField: 'ft_code',
-        addTitle: '资金转存',
-        addXtype: 'money-fundtransfer-formpanel',
-        defaultCondition:'',
-        baseVastUrl: '/api/money/fundtransfer/',
-        caller:'FundTransfer',
-        baseColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true
-        }, {
-            text: '单据编号',
-            dataIndex: 'ft_code',
-            width: 150
-        }, {
-            text: '日期',
-            dataIndex: 'ft_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '转出账户',
-            dataIndex: 'ftd_bankname',
-            width: 150
-        } , {
-            text: '转入账户',
-            dataIndex: 'ftd_inbankname',
-            width: 150
-        }, {
-            text: '金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'ftd_nowbalance',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-        }, {
-            text: '结算方式',
-            dataIndex: 'ftd_paymethod',
-            width: 150
-        }, {
-            text: '结算号',
-            dataIndex: 'ftd_paycode',
-            hidden: true
-        },{
-            text: '审核状态',
-            dataIndex: 'ft_status',
-            align: 'center',
-            width: 80
-        }, {
-            text: '备注',
-            dataIndex: 'ftd_remark',
-            width: 250
-        } ],
-        relativeColumn: []
-    }
+        });
+
+        this.callParent(arguments);
+    },
 });

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

@@ -6,194 +6,266 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
     viewModel: 'money-othreceipts-formpanel',
 
     viewName: 'money-othreceipts-formpanel',
-    caller:'OthReceipts',
-    
-     //字段属性
-     _title:'其它收入单',
-     _idField: 'id',
-     _codeField: 'or_code',
-     _statusField: 'or_status',
-     _statusCodeField: 'or_statuscode',
-     _auditmanField: 'or_auditman',
-     _auditdateField:'or_auditdate',
-     _relationColumn: 'ord_orid',
-     _readUrl:'/api/money/othreceipts/read',
-     _saveUrl:'/api/money/othreceipts/save',
-     _auditUrl:'/api/money/othreceipts/audit',
-     _unAuditUrl: '/api/money/othreceipts/unAudit',
-     _deleteUrl:'/api/money/othreceipts/delete',  
-     initId:0,
+    caller: 'OthReceipts',
 
-     initComponent: function () {
-        Ext.applyIf(this, {
+    //字段属性
+    _title: '其它收入单',
+    _idField: 'id',
+    _codeField: 'or_code',
+    _statusField: 'or_status',
+    _statusCodeField: 'or_statuscode',
+    _auditmanField: 'or_auditman',
+    _auditdateField: 'or_auditdate',
+    _relationColumn: 'ord_orid',
+    _readUrl: '/api/money/othreceipts/read',
+    _saveUrl: '/api/money/othreceipts/save',
+    _auditUrl: '/api/money/othreceipts/audit',
+    _unAuditUrl: '/api/money/othreceipts/unAudit',
+    _deleteUrl: '/api/money/othreceipts/delete',
+    initId: 0,
+
+    initComponent: function () {
+        Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
                 fieldLabel: 'id'
             }, {
-                 xtype : 'hidden',
-                 name : 'or_custid', 
-                 fieldLabel : '客户ID'
-            }, {
-                 xtype : 'hidden', 
-                 name : 'or_custcode', 
-                 fieldLabel : '客户编号'
-             }, {
-                 xtype : "customerDbfindTrigger", 
-                 name : "or_custname", 
-                 fieldLabel : "客户名称",
-                 // allowBlank : false
-             }, {
-                 xtype : 'hidden',
-                 name : 'or_bankid', 
-                 fieldLabel : '账户ID'
-             }, {
-                 xtype : 'hidden', 
-                 name : 'or_bankcode', 
-                 fieldLabel : '账户编号'
-             }, {
-                 xtype : "bandinfoDbfindTrigger", 
-                 name : "or_bankname", 
-                 fieldLabel : "账户名称",
-                 allowBlank : false
-             }, {
-                xtype:'datefield',
-                name : 'or_date',
-                fieldLabel : '单据日期',
+                xtype: 'hidden',
+                name: 'or_custid',
+                fieldLabel: '客户ID'
+            }, {
+                xtype: 'hidden',
+                name: 'or_custcode',
+                fieldLabel: '客户编号'
+            }, {
+                xtype: "customerDbfindTrigger",
+                name: "or_custname",
+                fieldLabel: "客户名称",
+                // allowBlank : false
+            }, {
+                xtype: 'hidden',
+                name: 'or_bankid',
+                fieldLabel: '账户ID'
+            }, {
+                xtype: 'hidden',
+                name: 'or_bankcode',
+                fieldLabel: '账户编号'
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "or_bankname",
+                fieldLabel: "账户名称",
+                allowBlank: false
+            }, {
+                xtype: 'datefield',
+                name: 'or_date',
+                fieldLabel: '单据日期',
                 defaultValue: new Date(),
-                allowBlank : false
-            },{
-                name : "detailGridField", 
-                xtype : "detailGridField", 
-                storeModel:'saas.model.money.Othreceipts',
-                detnoColumn:  'ord_detno',
-                deleteDetailUrl:'/api/money/othreceipts/deleteDetail',
-                columnWidth : 1,
-                columns : [
-                    {
-                        text : "id", 
-                        dataIndex : "id", 
-                        xtype : "numbercolumn",
-                        hidden:true
-                    }, {
-                        text : "期间",
-                        dataIndex : "ord_ym",
-                        editor : {
-                            xtype : "numberfield",
-                            readOnly: true
-                        },
-                        // defaultValue: Ext.Date.format(new Date(), 'Ym'),
-                        width : 110.0,
-                        hidden: true,
-                        items : null
-                    }, {
-                        text : "收入类别", 
-                        width : 150.0, 
-                        dataIndex : "ord_type",
-                        items : null,
-                        allowBlank : false,
-                        hiddenBtn:false,//true 则会关闭新增按钮功能
-                        editor : {
-                            xtype : "remotecombo", 
-                            storeUrl:'/api/document/fundinouttype/getCombo?condition=收入',
-                            addHandler:function(b){
-                                var document = Ext.create('saas.view.document.kind.Kind',{});
-                                var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
-                                this.dialog = form.getController().getView().add({
-                                    xtype: 'document-kind-childwin',
-                                    bind: {
-                                        title: '新增收入类别'
-                                    },
-                                    dataKind:'inoutkind',
-                                    belong:document.etc['inoutkind'],
-                                    _parent:form,
-                                    _combo:this.ownerCmp,
-                                    record:null,
-                                    session: true
-                                });
-                                this.dialog.show();
-                            }
-                        }
-                    }, {
-                        text : "金额(元)", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "ord_nowbalance", 
-                        width : 110.0,
-                        allowBlank : false,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 2
-                        },
-                        renderer : function(v) {
-                            return saas.util.BaseUtil.numberFormat(v, 2, true);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            return saas.util.BaseUtil.numberFormat(v, 2, true);
-                        }
-                    }, {
-                        text : "备注", 
-                        dataIndex : "ord_remark",
-                        width : 250, 
-                        editor : {
-                            xtype : "textfield"
+                allowBlank: false
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.Othreceipts',
+                detnoColumn: 'ord_detno',
+                deleteDetailUrl: '/api/money/othreceipts/deleteDetail',
+                columnWidth: 1,
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "期间",
+                    dataIndex: "ord_ym",
+                    editor: {
+                        xtype: "numberfield",
+                        readOnly: true
+                    },
+                    // defaultValue: Ext.Date.format(new Date(), 'Ym'),
+                    width: 110.0,
+                    hidden: true,
+                    items: null
+                }, {
+                    text: "收入类别",
+                    width: 150.0,
+                    dataIndex: "ord_type",
+                    items: null,
+                    allowBlank: false,
+                    hiddenBtn: false, //true 则会关闭新增按钮功能
+                    editor: {
+                        xtype: "remotecombo",
+                        storeUrl: '/api/document/fundinouttype/getCombo?condition=收入',
+                        addHandler: function (b) {
+                            var document = Ext.create('saas.view.document.kind.Kind', {});
+                            var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                            this.dialog = form.getController().getView().add({
+                                xtype: 'document-kind-childwin',
+                                bind: {
+                                    title: '新增收入类别'
+                                },
+                                dataKind: 'inoutkind',
+                                belong: document.etc['inoutkind'],
+                                _parent: form,
+                                _combo: this.ownerCmp,
+                                record: null,
+                                session: true
+                            });
+                            this.dialog.show();
                         }
                     }
-                ]
-            }, {
-                xtype : "numberfield", 
-                name : "or_amount", 
-                fieldLabel : "收款金额(元)",
-                readOnly:true
-            },{
-                xtype : "textfield", 
-                name : "or_remark", 
-                fieldLabel : "备注", 
-                allowBlank : true, 
-                columnWidth : 0.75
-            },{
-                xtype : "hidden", 
-                name : "creatorId", 
-                fieldLabel : "录入人ID", 
-                readOnly:true
-            },
-            {
-                xtype : "textfield", 
-                name : "creatorName", 
-                fieldLabel : "录入人", 
-                readOnly:true
-            }, {
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "录入日期",
-                readOnly:true, 
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "ord_nowbalance",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "ord_remark",
+                    width: 250,
+                    editor: {
+                        xtype: "textfield"
+                    }
+                }, {
+                    dataIndex: "ord_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ord_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ord_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ord_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "ord_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: "numberfield",
+                name: "or_amount",
+                fieldLabel: "收款金额(元)",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "or_remark",
+                fieldLabel: "备注",
+                allowBlank: true,
+                columnWidth: 0.75
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
                 defaultValue: new Date()
-            },{
-                xtype : "hidden", 
-                name : "updaterId", 
-                fieldLabel : "更新人ID", 
-                readOnly:true
-            },{
-                xtype : "hidden", 
-                name : "updaterName", 
-                fieldLabel : "更新人", 
-                readOnly:true
-            }, {
-                xtype : "hidden", 
-                name : "updateTime", 
-                fieldLabel : "更新日期",
-                readOnly:true, 
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
                 defaultValue: new Date()
-            },{
+            }, {
                 xtype: 'textfield',
                 name: 'or_auditman',
                 fieldLabel: '审核人',
-                readOnly:true
-            },{
+                readOnly: true
+            }, {
                 xtype: "datefield",
                 name: "or_auditdate",
                 fieldLabel: "审核日期",
-                readOnly:true
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "or_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "or_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "or_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "or_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "or_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }]
         });
         this.callParent(arguments);

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

@@ -6,184 +6,189 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
     viewModel: 'money-othreceipts-querypanel',
 
     viewName: 'money-othreceipts-querypanel',
-    
-    queryFormItems: [ {
-        xtype: 'textfield',
-        name: 'or_code',
-        emptyText:'请输入单号'
-    }, {
-        xtype : "customerDbfindTrigger", 
-        name : "or_custname", 
-        margin:'0 0 0 20',
-        emptyText:'请输入客户编号或名称'
-    },  {
-        xtype: 'condatefield',
-        name: 'or_date',
-        fieldLabel: '日期',
-        columnWidth: 0.5,
-        operation: 'between'
-    }, {
-        name: 'ord_type',
-        fieldLabel: '收入类别',
-        xtype : "remotecombo",
-        columnWidth: 0.25,
-        emptyText :'全部',
-        showDetail: true,
-        storeUrl:'/api/document/fundinouttype/getCombo?condition=收入',
-        hiddenBtn:true,//true 则会关闭新增按钮功能
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'ord_type like \'%' + value + '%\'';
-            }
-        }
-    }, {
-        xtype : "bandinfoDbfindTrigger", 
-        name : "or_bankname", 
-        fieldLabel : "账户名称",
-        emptyText:'请输入账户编号或名称'
-    }, {
-        xtype: 'combobox',
-        name: 'or_statuscode',
-        fieldLabel: '单据状态',
-        queryMode: 'local',
-        displayField: 'or_status',
-        valueField: 'or_statuscode',
-        emptyText :'全部',
-        columnWidth: 0.25,
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['or_statuscode', 'or_status'],
-        data: [
-            ["ALL", "全部"],
-            ["AUDITED", "已审核"],
-            ["UNAUDITED", "未审核"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
-                return 'or_statuscode=\'' + value + '\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'creatorName',
-        fieldLabel: '录入人',
-        emptyText:'请输入账户名称或姓名',
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'othreceipts.creatorName like\'%' + value + '%\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'or_auditman',
-        fieldLabel: '审核人',
-        emptyText:'请输入账户名称或姓名'
-    }],
-    moreQueryFormItems: [],
-    queryGridConfig: {
-        idField: 'id',
-        codeField: 'or_code',
-        addTitle: '其它收入单',
-        addXtype: 'money-othreceipts-formpanel',
-        defaultCondition:'',
-        baseVastUrl: '/api/money/othreceipts/',
-        caller:'OthReceipts',
-        baseColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true
-        }, {
-            text: '单据编号',
-            dataIndex: 'or_code',
-            width: 150
-        }  ,{
-            text: '日期',
-            dataIndex: 'or_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '客户名称',
-            dataIndex: 'or_custname',
-            width: 200
-        },  {
-            text: '结算账户',
-            dataIndex: 'or_bankname',
-            width: 150
-        }, {
-            text: '收款金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'or_amount',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'or_status',
-            width: 90
-        },  {
-            text: '备注',
-            dataIndex: 'or_remark',
-            width: 250
-        }],
-        relativeColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true
-        }, {
-            text: '单据编号',
-            dataIndex: 'or_code',
-            width: 150
-        }  ,{
-            text: '日期',
-            dataIndex: 'or_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '客户名称',
-            dataIndex: 'or_custname',
-            width: 200
-        },  {
-            text: '结算账户',
-            dataIndex: 'or_bankname',
-            width: 150
-        }, {
-            text: '收款金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'or_amount',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
+
+    initComponent: function () {
+        Ext.apply(this, {
+            queryFormItems: [{
+                xtype: 'textfield',
+                name: 'or_code',
+                emptyText: '请输入单号'
+            }, {
+                xtype: "customerDbfindTrigger",
+                name: "or_custname",
+                margin: '0 0 0 20',
+                emptyText: '请输入客户编号或名称'
+            }, {
+                xtype: 'condatefield',
+                name: 'or_date',
+                fieldLabel: '日期',
+                columnWidth: 0.5,
+                operation: 'between'
+            }, {
+                name: 'ord_type',
+                fieldLabel: '收入类别',
+                xtype: "remotecombo",
+                columnWidth: 0.25,
+                emptyText: '全部',
+                showDetail: true,
+                storeUrl: '/api/document/fundinouttype/getCombo?condition=收入',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
+                getCondition: function (value) {
+                    if (!value) {
+                        return '1=1';
+                    } else {
+                        return 'ord_type like \'%' + value + '%\'';
+                    }
+                }
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "or_bankname",
+                fieldLabel: "账户名称",
+                emptyText: '请输入账户编号或名称'
+            }, {
+                xtype: 'combobox',
+                name: 'or_statuscode',
+                fieldLabel: '单据状态',
+                queryMode: 'local',
+                displayField: 'or_status',
+                valueField: 'or_statuscode',
+                emptyText: '全部',
+                columnWidth: 0.25,
+                editable: false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['or_statuscode', 'or_status'],
+                    data: [
+                        ["ALL", "全部"],
+                        ["AUDITED", "已审核"],
+                        ["UNAUDITED", "未审核"]
+                    ]
+                }),
+                getCondition: function (value) {
+                    if (value == 'ALL') {
+                        return '1=1';
+                    } else {
+                        return 'or_statuscode=\'' + value + '\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'creatorName',
+                fieldLabel: '录入人',
+                emptyText: '请输入账户名称或姓名',
+                getCondition: function (value) {
+                    if (!value) {
+                        return '1=1';
+                    } else {
+                        return 'othreceipts.creatorName like\'%' + value + '%\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'or_auditman',
+                fieldLabel: '审核人',
+                emptyText: '请输入账户名称或姓名'
+            }],
+            moreQueryFormItems: [],
+            queryGridConfig: {
+                idField: 'id',
+                codeField: 'or_code',
+                addTitle: '其它收入单',
+                addXtype: 'money-othreceipts-formpanel',
+                defaultCondition: '',
+                baseVastUrl: '/api/money/othreceipts/',
+                caller: 'OthReceipts',
+                baseColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '单据编号',
+                    dataIndex: 'or_code',
+                    width: 150
+                }, {
+                    text: '日期',
+                    dataIndex: 'or_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '客户名称',
+                    dataIndex: 'or_custname',
+                    width: 200
+                }, {
+                    text: '结算账户',
+                    dataIndex: 'or_bankname',
+                    width: 150
+                }, {
+                    text: '收款金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'or_amount',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: '单据状态',
+                    align: 'center',
+                    dataIndex: 'or_status',
+                    width: 90
+                }, {
+                    text: '备注',
+                    dataIndex: 'or_remark',
+                    width: 250
+                }],
+                relativeColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '单据编号',
+                    dataIndex: 'or_code',
+                    width: 150
+                }, {
+                    text: '日期',
+                    dataIndex: 'or_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '客户名称',
+                    dataIndex: 'or_custname',
+                    width: 200
+                }, {
+                    text: '结算账户',
+                    dataIndex: 'or_bankname',
+                    width: 150
+                }, {
+                    text: '收款金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'or_amount',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: '单据状态',
+                    align: 'center',
+                    dataIndex: 'or_status',
+                    width: 90
+                }, {
+                    text: '收入类别',
+                    dataIndex: 'ord_type',
+                    width: 110
+                }, {
+                    text: '明细金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'ord_nowbalance',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                }, {
+                    text: '备注',
+                    dataIndex: 'ord_remark',
+                    width: 250
+                }]
             }
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'or_status',
-            width: 90
-        },{
-            text: '收入类别',
-            dataIndex: 'ord_type',
-            width: 110
-        } ,{
-            text: '明细金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'ord_nowbalance',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-        } ,{
-            text: '备注',
-            dataIndex: 'ord_remark',
-            width: 250
-        }]
-    }
+        });
+        this.callParent(arguments);
+    },
 });

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

@@ -25,7 +25,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
     initId: 0,
 
     initComponent: function () {
-        Ext.applyIf(this, {
+        Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
@@ -137,6 +137,51 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                     editor: {
                         xtype: "textfield"
                     },
+                }, {
+                    dataIndex: "osd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "osd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "osd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "osd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "osd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: 'numberfield',
@@ -191,6 +236,36 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 name: "os_auditdate",
                 fieldLabel: "审核日期",
                 readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "os_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "os_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "os_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "os_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "os_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }]
         });
         this.callParent(arguments);

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

@@ -6,183 +6,188 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
     viewModel: 'money-othspendings-querypanel',
 
     viewName: 'money-othspendings-querypanel',
-    
-    queryFormItems: [{
-        xtype: 'textfield',
-        name: 'os_code',
-        emptyText:'请输入单号'
-    }, {
-        xtype: 'vendorDbfindTrigger',
-        name: 'os_vendname',
-        margin:'0 0 0 20',
-        emptyText :'请输入供应商编号或名称'
-    },{
-        xtype: 'condatefield',
-        name: 'os_date',
-        columnWidth: 0.5,
-        fieldLabel: '日期'
-    }, {
-        name: 'osd_type',
-        fieldLabel: '支出类别',
-        xtype : "remotecombo",
-        emptyText :'全部',
-        showDetail: true,
-        storeUrl:'/api/document/fundinouttype/getCombo?condition=支出',
-        hiddenBtn:true,//true 则会关闭新增按钮功能
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'osd_type like \'%' + value + '%\'';
-            }
-        }
-    }, {
-        xtype : "bandinfoDbfindTrigger", 
-        name : "os_bankname", 
-        fieldLabel : "账户名称",
-        emptyText:'请输入账户编号或名称'
-    },{
-        xtype: 'combobox',
-        name: 'os_statuscode',
-        fieldLabel: '单据状态',
-        queryMode: 'local',
-        displayField: 'os_status',
-        valueField: 'os_statuscode',
-        emptyText :'全部',
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-        fields: ['os_statuscode', 'os_status'],
-        data: [
-            ["ALL", "全部"],
-            ["AUDITED", "已审核"],
-            ["UNAUDITED", "未审核"]
-        ]
-        }),
-        getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
-                return 'os_statuscode=\'' + value + '\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'creatorName',
-        fieldLabel: '录入人',
-        emptyText:'请输入账户名称或姓名',
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'othspendings.creatorName like\'%' + value + '%\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'os_auditman',
-        fieldLabel: '审核人',
-        emptyText:'请输入账户名称或姓名'
-    }],
-    moreQueryFormItems: [],
-    queryGridConfig: {
-        idField: 'id',
-        codeField: 'os_code',
-        addTitle: '其它支出单',
-        addXtype: 'money-othspendings-formpanel',
-        defaultCondition:'',
-        baseVastUrl: '/api/money/othspendings/',
-        caller:'OthSpendings',
-        baseColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true,
-            xtype: 'numbercolumn'
-        }, {
-            text: '单据编号',
-            dataIndex: 'os_code',
-            width: 150
-        }, {
-            text: '日期',
-            dataIndex: 'os_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '供应商名称',
-            dataIndex: 'os_vendname',
-            width:200
-        },{
-            text: '结算账户',
-            dataIndex: 'os_bankname',
-            width: 150
-        },{
-            text: '付款金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'os_amount',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'os_status',
-            width: 90
-        }, {
-            text: '备注',
-            dataIndex: 'os_remark',
-            width: 250
-        }],
-        relativeColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true,
-            xtype: 'numbercolumn'
-        }, {
-            text: '单据编号',
-            dataIndex: 'os_code',
-            width: 150
-        }, {
-            text: '日期',
-            dataIndex: 'os_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '供应商名称',
-            dataIndex: 'os_vendname',
-            width:200
-        },{
-            text: '结算账户',
-            dataIndex: 'os_bankname',
-            width: 150
-        },{
-            text: '付款金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'os_amount',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
+
+    initComponent: function () {
+        Ext.apply(this, {
+            queryFormItems: [{
+                xtype: 'textfield',
+                name: 'os_code',
+                emptyText: '请输入单号'
+            }, {
+                xtype: 'vendorDbfindTrigger',
+                name: 'os_vendname',
+                margin: '0 0 0 20',
+                emptyText: '请输入供应商编号或名称'
+            }, {
+                xtype: 'condatefield',
+                name: 'os_date',
+                columnWidth: 0.5,
+                fieldLabel: '日期'
+            }, {
+                name: 'osd_type',
+                fieldLabel: '支出类别',
+                xtype: "remotecombo",
+                emptyText: '全部',
+                showDetail: true,
+                storeUrl: '/api/document/fundinouttype/getCombo?condition=支出',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
+                getCondition: function (value) {
+                    if (!value) {
+                        return '1=1';
+                    } else {
+                        return 'osd_type like \'%' + value + '%\'';
+                    }
+                }
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "os_bankname",
+                fieldLabel: "账户名称",
+                emptyText: '请输入账户编号或名称'
+            }, {
+                xtype: 'combobox',
+                name: 'os_statuscode',
+                fieldLabel: '单据状态',
+                queryMode: 'local',
+                displayField: 'os_status',
+                valueField: 'os_statuscode',
+                emptyText: '全部',
+                editable: false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['os_statuscode', 'os_status'],
+                    data: [
+                        ["ALL", "全部"],
+                        ["AUDITED", "已审核"],
+                        ["UNAUDITED", "未审核"]
+                    ]
+                }),
+                getCondition: function (value) {
+                    if (value == 'ALL') {
+                        return '1=1';
+                    } else {
+                        return 'os_statuscode=\'' + value + '\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'creatorName',
+                fieldLabel: '录入人',
+                emptyText: '请输入账户名称或姓名',
+                getCondition: function (value) {
+                    if (!value) {
+                        return '1=1';
+                    } else {
+                        return 'othspendings.creatorName like\'%' + value + '%\'';
+                    }
+                }
+            }, {
+                xtype: 'accountDbfindTrigger',
+                name: 'os_auditman',
+                fieldLabel: '审核人',
+                emptyText: '请输入账户名称或姓名'
+            }],
+            moreQueryFormItems: [],
+            queryGridConfig: {
+                idField: 'id',
+                codeField: 'os_code',
+                addTitle: '其它支出单',
+                addXtype: 'money-othspendings-formpanel',
+                defaultCondition: '',
+                baseVastUrl: '/api/money/othspendings/',
+                caller: 'OthSpendings',
+                baseColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true,
+                    xtype: 'numbercolumn'
+                }, {
+                    text: '单据编号',
+                    dataIndex: 'os_code',
+                    width: 150
+                }, {
+                    text: '日期',
+                    dataIndex: 'os_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '供应商名称',
+                    dataIndex: 'os_vendname',
+                    width: 200
+                }, {
+                    text: '结算账户',
+                    dataIndex: 'os_bankname',
+                    width: 150
+                }, {
+                    text: '付款金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'os_amount',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: '单据状态',
+                    align: 'center',
+                    dataIndex: 'os_status',
+                    width: 90
+                }, {
+                    text: '备注',
+                    dataIndex: 'os_remark',
+                    width: 250
+                }],
+                relativeColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true,
+                    xtype: 'numbercolumn'
+                }, {
+                    text: '单据编号',
+                    dataIndex: 'os_code',
+                    width: 150
+                }, {
+                    text: '日期',
+                    dataIndex: 'os_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '供应商名称',
+                    dataIndex: 'os_vendname',
+                    width: 200
+                }, {
+                    text: '结算账户',
+                    dataIndex: 'os_bankname',
+                    width: 150
+                }, {
+                    text: '付款金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'os_amount',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: '单据状态',
+                    align: 'center',
+                    dataIndex: 'os_status',
+                    width: 90
+                }, {
+                    text: '支出类别',
+                    dataIndex: 'osd_type',
+                    width: 110
+                }, {
+                    text: '明细金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'osd_nowbalance',
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                }, {
+                    text: '备注',
+                    dataIndex: 'osd_remark',
+                    width: 250
+                }]
             }
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'os_status',
-            width: 90
-        }, {
-            text: '支出类别',
-            dataIndex: 'osd_type',
-            width: 110
-        }, {
-            text: '明细金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'osd_nowbalance',
-            width: 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-        },{
-            text: '备注',
-            dataIndex: 'osd_remark',
-            width: 250
-        }]
-    }
+        });
+        this.callParent(arguments);
+    },
 });

+ 119 - 18
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -26,7 +26,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
     toolBtns: [],
 
     initComponent: function () {
-        Ext.applyIf(this, {
+        Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
@@ -99,6 +99,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 fieldLabel: '已核销金额(元)'
             }, {
                 xtype: "detailGridField",
+                name: 'detail1',
                 storeModel: 'saas.model.money.PayBalance1',
                 detnoColumn: 'pd_detno',
                 deleteDetailUrl: '/api/money/paybalance/deleteDetail1',
@@ -149,7 +150,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 }, {
                     text: "结算方式",
                     dataIndex: "pd_paymethod",
-                    width: 200.0,
+                    width: 150.0,
                     editor: {
                         xtype: 'combo',
                         queryMode: 'local',
@@ -184,7 +185,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 }, {
                     text: "结算号",
                     dataIndex: "pd_paycode",
-                    width: 150.0,
                     editor: {
                         xtype: 'textfield'
                     }
@@ -195,9 +195,55 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                     editor: {
                         xtype: 'textfield'
                     }
+                }, {
+                    dataIndex: "pd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: "detailGridField",
+                name: 'detail2',
                 storeModel: 'saas.model.money.PayBalance2',
                 detnoColumn: 'pbd_detno',
                 allowEmpty: true,
@@ -304,6 +350,51 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                     dataIndex: 'pbd_remark',
                     width: 250,
                     hidden: true
+                }, {
+                    dataIndex: "pbd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pbd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pbd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pbd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "pbd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: 'textfield',
@@ -353,25 +444,35 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 fieldLabel: "审核日期",
                 readOnly: true
             }, {
-                xtype: 'hidden',
-                name: 'pb_text1',
-                fieldLabel: '自定义字段1'
+                xtype: "textfield",
+                name: "pb_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
             }, {
-                xtype: 'hidden',
-                name: 'pb_text2',
-                fieldLabel: '自定义字段2'
+                xtype: "textfield",
+                name: "pb_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
             }, {
-                xtype: 'hidden',
-                name: 'pb_text3',
-                fieldLabel: '自定义字段3'
+                xtype: "textfield",
+                name: "pb_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
             }, {
-                xtype: 'hidden',
-                name: 'pb_text4',
-                fieldLabel: '自定义字段4'
+                xtype: "textfield",
+                name: "pb_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
             }, {
-                xtype: 'hidden',
-                name: 'pb_text5',
-                fieldLabel: '自定义字段5'
+                xtype: "textfield",
+                name: "pb_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
         });
         this.callParent(arguments);

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

@@ -218,10 +218,9 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
               
             }
         })
-        .catch(function(res) {
+        .catch(function(e) {
             form.setLoading(false);
-            console.error(res);
-            saas.util.BaseUtil.showErrorToast('转单失败: ' + res.message);
+            saas.util.BaseUtil.showErrorToast('转单失败: ' + e.message);
         });
      },
 

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

@@ -7,150 +7,159 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
 
     viewName: 'money-paybalance-querypanel',
     
-    queryFormItems: [{
-        xtype: 'hidden',
-        name: 'pb_id',
-        fieldLabel: 'ID',
-        allowBlank: true,
-        getCondition: function(value) {
-            return 'pb_id=' + value;
-        }
-    }, {
-        xtype: 'textfield',
-        name: 'pb_code',
-        emptyText :'请输入单号'
-    }, {
-        xtype: 'vendorDbfindTrigger',
-        name: 'pb_vendname',
-        margin:'0 0 0 20',
-        emptyText :'请输入供应商编号或名称'
-    }, {
-        xtype: 'condatefield',
-        name: 'pb_date',
-        fieldLabel: '日期',
-        columnWidth: 0.5,
-        operation: 'between'
-    }/*,  {
-        xtype: 'textfield',
-        name: 'pbd_slcode',
-        fieldLabel: '来源单号',
-        showDetail: true
-    } ,{
-        xtype:'textfield',
-        name:'pbd_slkind',
-        fieldLabel: '业务类型',
-        showDetail: true
-    }*/, {
-        xtype: 'accountDbfindTrigger',
-        name: 'creatorName',
-        fieldLabel: '录入人',
-        emptyText:'请输入账户名称或姓名',
-        getCondition: function(value) {
-            if(!value) {
-                return '1=1';
-            }else {
-                return 'paybalance.creatorName like\'%' + value + '%\'';
-            }
-        }
-    }, {
-        xtype: 'accountDbfindTrigger',
-        name: 'pb_auditman',
-        fieldLabel: '审核人',
-        emptyText:'请输入账户名称或姓名'
-    }],
-    moreQueryFormItems: [],
-    queryGridConfig: {
-        idField: 'id',
-        codeField: 'pb_code',
-        addTitle: '付款单',
-        addXtype: 'money-paybalance-formpanel',
-        defaultCondition: '',
-        baseVastUrl: '/api/money/paybalance/',
-        caller: 'PayBalance',
-        baseColumn: [
-            {
-                text: 'id',
-                dataIndex: 'id',
-                xtype: 'numbercolumn',
-                hidden: true
+    initComponent: function() {
+        Ext.apply(this, {
+            queryFormItems: [{
+                xtype: 'hidden',
+                name: 'pb_id',
+                fieldLabel: 'ID',
+                allowBlank: true,
+                getCondition: function(value) {
+                    return 'pb_id=' + value;
+                }
             }, {
-                text: '付款单号',
-                dataIndex: 'pb_code',
-                width: 130
+                xtype: 'textfield',
+                name: 'pb_code',
+                emptyText :'请输入单号'
             }, {
-                text: '日期',
-                dataIndex: 'pb_date',
-                xtype: 'datecolumn',
-                width: 100
+                xtype: 'vendorDbfindTrigger',
+                name: 'pb_vendname',
+                margin:'0 0 0 20',
+                emptyText :'请输入供应商编号或名称'
             }, {
-                text: '供应商名称',
-                dataIndex: 'pb_vendname',
-                width: 200,
+                xtype: 'condatefield',
+                name: 'pb_date',
+                fieldLabel: '日期',
+                columnWidth: 0.5,
+                operation: 'between'
             }, {
-                text: '单据状态',
-                align: 'center',
-                dataIndex: 'pb_status',
-                width: 90
+                xtype: 'accountDbfindTrigger',
+                name: 'creatorName',
+                fieldLabel: '录入人',
+                emptyText:'请输入账户名称或姓名',
+                getCondition: function(value) {
+                    if(!value) {
+                        return '1=1';
+                    }else {
+                        return 'paybalance.creatorName like\'%' + value + '%\'';
+                    }
+                }
             }, {
-                text: '付款人',
-                dataIndex: 'pb_manname',
-                width: 110
+                xtype: 'accountDbfindTrigger',
+                name: 'pb_auditman',
+                fieldLabel: '审核人',
+                emptyText:'请输入账户名称或姓名'
             }, {
-                text: '备注',
-                dataIndex: 'pb_remark',
-                width: 250
+                xtype: 'bandinfoDbfindTrigger',
+                name: 'pd_bankcode',
+                fieldLabel: '资金账户',
+                emptyText:'请输入资金账户名称或姓名',
+                showDetail: true
             }],
-        relativeColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            xtype: 'numbercolumn',
-            hidden: true
-        }, {
-            text: '付款单号',
-            dataIndex: 'pb_code',
-            width: 130
-        }, {
-            text: '日期',
-            dataIndex: 'pb_date',
-            xtype: 'datecolumn',
-            width: 100
-        }, {
-            text: '供应商名称',
-            dataIndex: 'pb_vendname',
-            width: 200,
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'pb_status',
-            width: 90
-        }, {
-            text: '付款人',
-            dataIndex: 'pb_manname',
-            width: 110
-        },{
-            text: '资金账户',
-            dataIndex: 'pd_bankname',
-            width: 110
-        },{
-            text: '付款金额(元)',
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_amount',
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-        } ,{
-            text: '结算方式',
-            dataIndex: 'pd_paymethod',
-            width: 100
-        },{
-            text: '结算号',
-            dataIndex: 'pd_paycode',
-            width: 100
-        },{
-            text: '备注',
-            dataIndex: 'pd_remark',
-            width: 250
-        }]
-    }
+            moreQueryFormItems: [],
+            queryGridConfig: {
+                idField: 'id',
+                codeField: 'pb_code',
+                addTitle: '付款单',
+                addXtype: 'money-paybalance-formpanel',
+                defaultCondition: '',
+                baseVastUrl: '/api/money/paybalance/',
+                caller: 'PayBalance',
+                baseColumn: [
+                    {
+                        text: 'id',
+                        dataIndex: 'id',
+                        xtype: 'numbercolumn',
+                        hidden: true
+                    }, {
+                        text: '付款单号',
+                        dataIndex: 'pb_code',
+                        width: 150
+                    }, {
+                        text: '单据日期',
+                        dataIndex: 'pb_date',
+                        xtype: 'datecolumn',
+                        width: 110
+                    }, {
+                        text: '供应商名称',
+                        dataIndex: 'pb_vendname',
+                        width: 200,
+                    }, {
+                        text: '单据状态',
+                        align: 'center',
+                        dataIndex: 'pb_status',
+                        width: 80
+                    }, {
+                        text: '付款金额(元)',
+                        xtype: 'numbercolumn',
+                        dataIndex: 'pb_amount',
+                        width: 120,
+                        renderer: function (v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        },
+                    }, {
+                        text: '付款人',
+                        dataIndex: 'pb_manname',
+                        width: 110
+                    }, {
+                        text: '备注',
+                        dataIndex: 'pb_remark',
+                        width: 250
+                    }],
+                relativeColumn: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    xtype: 'numbercolumn',
+                    hidden: true
+                }, {
+                    text: '付款单号',
+                    dataIndex: 'pb_code',
+                    width: 150
+                }, {
+                    text: '单据日期',
+                    dataIndex: 'pb_date',
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: '供应商名称',
+                    dataIndex: 'pb_vendname',
+                    width: 200,
+                }, {
+                    text: '单据状态',
+                    align: 'center',
+                    dataIndex: 'pb_status',
+                    width: 80
+                }, {
+                    text: '付款人',
+                    dataIndex: 'pb_manname',
+                    width: 80
+                },{
+                    text: '资金账户',
+                    dataIndex: 'pd_bankname',
+                    width: 150
+                },{
+                    text: '付款金额(元)',
+                    xtype: 'numbercolumn',
+                    dataIndex: 'pd_amount',
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                } ,{
+                    text: '结算方式',
+                    dataIndex: 'pd_paymethod',
+                    width: 120
+                },{
+                    text: '结算号',
+                    dataIndex: 'pd_paycode',
+                    width: 120
+                },{
+                    text: '备注',
+                    dataIndex: 'pd_remark',
+                    width: 250
+                }]
+            }
+        });
+        this.callParent(arguments);
+    },
 });

+ 12 - 0
frontend/saas-web/app/view/money/payBalance/QueryPanelController.js

@@ -31,6 +31,18 @@ Ext.define('saas.view.money.paybalance.QueryPanelController', {
                         }],
                     });
                 }
+            },'bandinfoDbfindTrigger[name=pd_bankcode]':{
+                beforerender: function (f) {
+                    Ext.apply(f, {
+                        dbfinds: [{
+                            from: 'id', to: 'pd_bankid',ignore:true
+                        }, {
+                            from:'bk_bankcode', to:'pd_bankcode'
+                        },{
+                            from:'bk_bankname', to:'pd_bankcode'
+                        }],
+                    });
+                }
             }
         });
 

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

@@ -25,7 +25,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     initId: 0,
 
     initComponent: function () {
-        Ext.applyIf(this, {
+        Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
@@ -96,6 +96,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 fieldLabel: '已核销金额(元)'
             }, {
                 xtype: "detailGridField",
+                name: 'detail1',
                 storeModel: 'saas.model.money.RecBalance1',
                 detnoColumn: 'rd_detno',
                 deleteDetailUrl: '/api/money/recbalance/deleteDetail1',
@@ -196,9 +197,55 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                     editor: {
                         xtype: 'textfield'
                     }
+                }, {
+                    dataIndex: "rd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: "detailGridField",
+                name: 'detail2',
                 storeModel: 'saas.model.money.RecBalance2',
                 detnoColumn: 'rbd_detno',
                 allowEmpty: true,
@@ -305,6 +352,51 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                     summaryRenderer: function (v) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    dataIndex: "rbd_text1",
+                    text: "自定义字段1",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rbd_text2",
+                    text: "自定义字段2",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rbd_text3",
+                    text: "自定义字段3",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rbd_text4",
+                    text: "自定义字段4",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }, {
+                    dataIndex: "rbd_text5",
+                    text: "自定义字段5",
+                    width: 100,
+                    hidden: true,
+                    initHidden: false,
+                    editor: {
+                        xtype: "textfield"
+                    },
                 }]
             }, {
                 xtype: 'textfield',
@@ -353,6 +445,36 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 name: "rb_auditdate",
                 fieldLabel: "审核日期",
                 readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "rb_text1",
+                fieldLabel: "自定义字段1",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "rb_text2",
+                fieldLabel: "自定义字段2",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "rb_text3",
+                fieldLabel: "自定义字段3",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "rb_text4",
+                fieldLabel: "自定义字段4",
+                hidden: true,
+                initHidden: false
+            }, {
+                xtype: "textfield",
+                name: "rb_text5",
+                fieldLabel: "自定义字段5",
+                hidden: true,
+                initHidden: false
             }],
         });
         this.callParent(arguments);

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