浏览代码

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

huangx 7 年之前
父节点
当前提交
0458863268
共有 66 个文件被更改,包括 918 次插入318 次删除
  1. 8 0
      applications/commons/commons-server/src/main/resources/application.yml
  2. 1 1
      applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml
  3. 0 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  4. 8 0
      applications/document/document-server/src/main/resources/application.yml
  5. 1 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  6. 10 2
      applications/money/money-server/src/main/resources/application.yml
  7. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java
  8. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  9. 14 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  10. 4 16
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  11. 8 0
      applications/purchase/purchase-server/src/main/resources/application.yml
  12. 13 7
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  13. 78 29
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  14. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  15. 4 4
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  16. 8 0
      applications/sale/sale-server/src/main/resources/application.yml
  17. 2 2
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  18. 1 1
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  19. 2 2
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  20. 8 0
      applications/storage/storage-server/src/main/resources/application.yml
  21. 12 0
      base-servers/account/account-server/src/main/resources/application.yml
  22. 21 17
      base-servers/auth/auth-client/src/main/java/com/usoftchina/saas/auth/client/interceptor/AuthRestInterceptor.java
  23. 15 0
      base-servers/auth/auth-server/src/main/resources/application.yml
  24. 12 0
      base-servers/gateway-server/src/main/resources/application.yml
  25. 12 0
      base-servers/ui-server/src/main/resources/application.yml
  26. 66 67
      frontend/saas-web/app/Application.scss
  27. 3 0
      frontend/saas-web/app/util/FormUtil.js
  28. 2 2
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  29. 1 0
      frontend/saas-web/app/view/core/form/FormPanel.js
  30. 30 14
      frontend/saas-web/app/view/core/form/FormPanelController.js
  31. 22 0
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  32. 7 0
      frontend/saas-web/app/view/core/query/QueryPanel.js
  33. 2 0
      frontend/saas-web/app/view/core/tab/Controller.js
  34. 5 1
      frontend/saas-web/app/view/document/kind/ChildForm.js
  35. 3 0
      frontend/saas-web/app/view/document/kind/Kind.js
  36. 4 0
      frontend/saas-web/app/view/document/kind/KindController.js
  37. 2 1
      frontend/saas-web/app/view/document/product/FormPanel.js
  38. 3 2
      frontend/saas-web/app/view/main/Navigation.js
  39. 2 24
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  40. 7 0
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  41. 10 11
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  42. 12 6
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  43. 9 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelModel.js
  44. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  45. 24 8
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  46. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  47. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  48. 1 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  49. 1 1
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  50. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  51. 1 1
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  52. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  53. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  54. 14 12
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  55. 1 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  56. 1 1
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  57. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  58. 1 1
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js
  59. 304 0
      frontend/saas-web/app/view/stock/stockamount/DataList.js
  60. 10 0
      frontend/saas-web/app/view/stock/stockamount/DataListController.js
  61. 4 0
      frontend/saas-web/app/view/stock/stockamount/DataListlModel.js
  62. 47 21
      frontend/saas-web/app/view/sys/config/FormPanel.js
  63. 28 36
      frontend/saas-web/app/view/sys/config/FormPanelController.js
  64. 20 9
      frontend/saas-web/app/view/sys/finish/DataList.js
  65. 11 0
      frontend/saas-web/overrides/i18n.js
  66. 5 1
      frontend/saas-web/resources/json/navigation.json

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

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

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

@@ -22,7 +22,7 @@
         <result column="ml_keyvalue" property="ml_keyvalue" jdbcType="INTEGER" />
     </resultMap>
     <select id="getListData" resultMap="MsgResult">
-        SELECT * FROM MESSAGELOG WHERE ML_CALLER='EndProduct' AND COMPANYID=#{companyId} AND ml_result='记账成功'
+        SELECT * FROM MESSAGELOG WHERE ML_CALLER='EndProduct' AND COMPANYID=#{companyId} AND ml_result like '%记账成功' ORDER BY ML_ID DESC
     </select>
 
     <select id="endProduct" parameterMap="spParamMap" statementType="CALLABLE">

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

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

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

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

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

@@ -66,7 +66,7 @@
                 ${con}
             </if>
             <if test="companyId != null">
-                and  PRODUCT.companyid = #{companyId}
+                and  PRODUCT.companyid = #{companyId} and productonhand.companyId=#{companyId}
             </if>
         </where>
     </select>

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

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

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

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

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

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

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

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

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

@@ -180,12 +180,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
         baseDTO = getBaseDTOById(pu_id);
 
-        //取供应商汇率
-        getVendorTaxrate(pu_id);
-        //取价
-        getPrice(pu_id);
-
-
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志
@@ -193,14 +187,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         return baseDTO;
     }
 
-    private void getVendorTaxrate(Long pu_id) {
-//        purchasedetailMapper.getVendorTaxrate(pu_id);
-    }
-
-    private void getPrice(Long pu_id) {
-//        purchasedetailMapper.getPrice(pu_id);
-    }
-
 
     @Override
     @Transactional
@@ -461,7 +447,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 //公司id
                 prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
                 prodIODetail.setCreateTime(new Date());
-
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);
@@ -470,7 +455,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
             }
         }
-        //采购单相关计算
+        //更新默认仓库
+        prodInOutService.getDefaultWarehouseByProduct(pi_id);
+
+        //采购验收单相关计算
         prodInOutService.calcProdInout(pi_id,"采购验收单");
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setId(pi_id);

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

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

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

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

+ 78 - 29
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -361,32 +361,81 @@
   <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update purchasedetail <set>
-      PD_PUID = #{item.pd_puid},
-      PD_CODE = #{item.pd_code},
-      PD_DETNO = #{item.pd_detno},
-      PD_PRODID = #{item.pd_prodid},
-      PD_PRODCODE = #{item.pd_prodcode},
-      PD_UNIT = #{item.pd_unit},
-      PD_QTY = #{item.pd_qty},
-      PD_PRICE = #{item.pd_price},
-      PD_TAXPRICE = #{item.pd_taxprice},
-      PD_TOTAL = #{item.pd_total},
-      PD_TAXRATE = #{item.pd_taxrate},
-      PD_TAXTOTAL = #{item.pd_taxtotal},
-      PD_ACCEPTQTY = #{item.pd_acceptqty},
-      PD_DELIVERY = #{item.pd_delivery},
-      PD_SALECODE = #{item.pd_salecode},
-      PD_SALEDETNO = #{item.pd_saledetno},
-      PD_SDID = #{item.pd_sdid},
-      companyId = #{item.companyId},
-      updaterId = #{item.updaterId},
-      updateTime = #{item.updateTime},
-      pd_text1 = #{item.pd_text1},
-      pd_text2 = #{item.pd_text2},
-      pd_text3 = #{item.pd_text3},
-      pd_text4 = #{item.pd_text4},
-      pd_text5 = #{item.pd_text5},
-      pd_yqty = #{item.pd_yqty}
+      <if test="item.pd_puid != null" >
+        PD_PUID = #{item.pd_puid,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_code != null" >
+        PD_CODE = #{item.pd_code,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_detno != null" >
+        PD_DETNO = #{item.pd_detno,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_prodid != null" >
+        PD_PRODID = #{item.pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_prodcode != null" >
+        PD_PRODCODE = #{item.pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_unit != null" >
+        PD_UNIT = #{item.pd_unit,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_qty != null" >
+        PD_QTY = #{item.pd_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_price != null" >
+        PD_PRICE = #{item.pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_total != null" >
+        PD_TOTAL = #{item.pd_total,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_taxrate != null" >
+        PD_TAXRATE = #{item.pd_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_taxtotal != null" >
+        PD_TAXTOTAL = #{item.pd_taxtotal,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_acceptqty != null" >
+        PD_ACCEPTQTY = #{item.pd_acceptqty,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_delivery != null" >
+        PD_DELIVERY = #{item.pd_delivery,jdbcType=DOUBLE},
+      </if>
+      <if test="item.pd_salecode != null" >
+        PD_SALECODE = #{item.pd_salecode,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_saledetno != null" >
+        PD_SALEDETNO = #{item.pd_saledetno,jdbcType=INTEGER},
+      </if>
+      <if test="item.pd_sdid != null" >
+        PD_SDID = #{item.pd_sdid,jdbcType=INTEGER},
+      </if>
+      <if test="item.companyId != null" >
+        companyId = #{item.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updaterId != null" >
+        updaterId = #{item.updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updateTime != null" >
+        updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="item.pd_text1 != null" >
+        pd_text1 = #{item.pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text2 != null" >
+        pd_text2 = #{item.pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text3 != null" >
+        pd_text3 = #{item.pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text4 != null" >
+        pd_text4 = #{item.pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_text5 != null" >
+        pd_text5 = #{item.pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="item.pd_yqty != null" >
+        pd_yqty = #{item.pd_yqty,jdbcType=DOUBLE},
+      </if>
       </set>
       where PD_ID = #{item.id,jdbcType=INTEGER}
     </foreach>
@@ -410,9 +459,9 @@
 
   <update id="calcPurchase" parameterType="long" >
     update purchasedetail set pd_taxprice = ifnull(PD_PRICE,0)/(1+ifnull(pd_taxrate,0)/100) where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchasedetail set pd_total = ifnull(PD_PRICE,0)*ifnull(pd_qty,0),pd_taxtotal = pd_taxprice*ifnull(pd_qty,0) where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchase set pu_total = (select sum(pd_total) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
-    update purchase set PU_TAXTOTAL = (select sum(pd_taxtotal) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
+    update purchasedetail set pd_total = round(ifnull(PD_PRICE,0)*ifnull(pd_qty,0),2),pd_taxtotal = round(pd_taxprice*ifnull(pd_qty,0),2) where pd_puid = #{pu_id,jdbcType=INTEGER};
+    update purchase set pu_total = round((select sum(pd_total) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ),2)  where pu_id = #{pu_id,jdbcType=INTEGER};
+    update purchase set PU_TAXTOTAL = round((select sum(pd_taxtotal) from purchasedetail where pd_puid = #{pi_id,jdbcType=INTEGER} ),2)  where pu_id = #{pu_id,jdbcType=INTEGER};
   </update>
 
 

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

@@ -444,7 +444,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 targetPid.setPd_piid(pi_id);
                 targetPid.setPd_inoutno(piInoutno);
                 targetPid.setPd_piclass(BillCodeSeq.SALEIN.getName());
-                targetPid.setPd_pdno(i);
+                targetPid.setPd_pdno(i + 1);
                 targetPid.setPd_orderid(sourcePid.getPd_orderid());
                 targetPid.setPd_ordercode(sourcePid.getPd_ordercode());
                 targetPid.setPd_orderdetno(sourcePid.getPd_orderdetno());

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

@@ -443,13 +443,13 @@ public class SaleServiceImpl implements SaleService{
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
         long pi_id = prodInOut.getId();
-        for (int i=0;i<details.size();i++){
+        for (int i = 0; i < details.size(); i++){
             SaleDetail saleDetail =details.get(i);
             ProdIODetail prodIODetail = new ProdIODetail();
             prodIODetail.setPd_piid(pi_id);
             prodIODetail.setPd_inoutno(pi_inoutno);
             prodIODetail.setPd_piclass(BillCodeSeq.SALEOUT.getName());
-            prodIODetail.setPd_pdno(i);
+            prodIODetail.setPd_pdno(i + 1);
             prodIODetail.setPd_orderid(sale.getId());
             prodIODetail.setPd_ordercode(sale.getSa_code());
             prodIODetail.setPd_orderdetno(saleDetail.getSd_detno());
@@ -461,7 +461,7 @@ public class SaleServiceImpl implements SaleService{
             //公司id
             prodIODetail.setCompanyId(companyId);
             //本次转单数
-            prodIODetail.setPd_outqty((saleDetail.getSd_qty()-saleDetail.getSd_yqty()));
+            prodIODetail.setPd_outqty(saleDetail.getSd_qty() - saleDetail.getSd_yqty());
             prodIODetailMapper.insertSelective(prodIODetail);
             //更新已转数
             saleDetail.setSd_yqty(saleDetail.getSd_qty());
@@ -473,8 +473,8 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_sendstatuscode(Status.TURNOUT.name());
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);
-        prodInOutMapper.updatePiTotal(pi_id);
         prodIODetailMapper.updatePDSaleOut(pi_id);
+        prodInOutMapper.updatePiTotal(pi_id);
         //日志记录
         DocBaseDTO baseDTO = new DocBaseDTO(pi_id, pi_inoutno, BillCodeSeq.SALEOUT.getName());
         messageLogService.customizeLog(baseDTO, Operation.TURNPRODOUT);

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

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

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

@@ -767,8 +767,8 @@ update prodiodetail a
   <update id="updatePDSaleOut" parameterType="long">
     update prodiodetail set
     pd_total=round(IFNULL(pd_outqty,0)*IFNULL(pd_sendprice,0),2),
-    pd_netprice = round(IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),0),
-    pd_nettotal = round((IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_outqty,0),0)
+    pd_netprice = round(IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),2),
+    pd_nettotal = round((IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_outqty,0),2)
     where pd_piid=#{id}
   </update>
 </mapper>

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

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

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

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

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

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

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

@@ -55,6 +55,18 @@ server:
   port: 8580
   tomcat:
     uri-encoding: UTF-8
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

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

@@ -27,23 +27,27 @@ public class AuthRestInterceptor extends HandlerInterceptorAdapter {
 
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-        HandlerMethod handlerMethod = (HandlerMethod) handler;
-        // 配置该注解,说明不进行用户拦截
-        IgnoreAuth annotation = handlerMethod.getBeanType().getAnnotation(IgnoreAuth.class);
-        if (annotation == null) {
-            annotation = handlerMethod.getMethodAnnotation(IgnoreAuth.class);
-        }
-        if (annotation != null) {
-            return super.preHandle(request, response, handler);
-        }
-        String token = request.getHeader(authConfig.getAuthHeader());
-        if (null != token) {
-            JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
-            BaseContextHolder.setAppId(infoFromToken.getAppId());
-            BaseContextHolder.setUserId(infoFromToken.getUserId());
-            BaseContextHolder.setCompanyId(infoFromToken.getCompanyId());
-            BaseContextHolder.setToken(token);
-            log.info("token={} \\r\\n userName={}", token, infoFromToken.getUserName());
+        if (handler instanceof HandlerMethod) {
+            HandlerMethod handlerMethod = (HandlerMethod) handler;
+            // 配置该注解,说明不进行用户拦截
+            IgnoreAuth annotation = handlerMethod.getBeanType().getAnnotation(IgnoreAuth.class);
+            if (annotation == null) {
+                annotation = handlerMethod.getMethodAnnotation(IgnoreAuth.class);
+            }
+            if (annotation != null) {
+                return super.preHandle(request, response, handler);
+            }
+            String token = request.getHeader(authConfig.getAuthHeader());
+            if (null != token) {
+                JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
+                BaseContextHolder.setAppId(infoFromToken.getAppId());
+                BaseContextHolder.setUserId(infoFromToken.getUserId());
+                BaseContextHolder.setCompanyId(infoFromToken.getCompanyId());
+                BaseContextHolder.setToken(token);
+                log.info("token={} \\r\\n userName={}", token, infoFromToken.getUserName());
+            }
+        } else {
+            // no mapping
         }
         return super.preHandle(request, response, handler);
     }

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

@@ -35,6 +35,9 @@ spring:
       connection-timeout: 30000
   messages:
     basename: i18n/messages
+  redis:
+    host: 192.168.253.12
+    port: 6379
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10
@@ -52,6 +55,18 @@ server:
   port: 8600
   tomcat:
     uri-encoding: UTF-8
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

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

@@ -124,6 +124,18 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 feign:
   hystrix:
     enabled: true

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

@@ -42,6 +42,18 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+    restart:
+      enabled: true
 info:
   name: '@project.artifactId@'
   description: '@project.description@'

+ 66 - 67
frontend/saas-web/app/Application.scss

@@ -1,76 +1,75 @@
-html, body {
-    height: 100%;
-    margin: 0;
-  }
-  
-  body.launching {
+html,
+body {
+  height: 100%;
+  margin: 0;
+}
+
+body.launching {
+  @include background-size(cover);
+  background-color: $auth-background-color;
+  background-image: $auth-background-image;
+  background-position: center;
+
+  &::before {
+    @include animation(rotate-animation 1s linear infinite);
+    @include transform-origin(50% 50%);
     @include background-size(cover);
-    background-color: $auth-background-color;
-    background-image: $auth-background-image;
+    background-image: url(get-resource-path('images/loading.png'));
     background-position: center;
-  
-    &::before {
-        @include animation(rotate-animation 1s linear infinite);
-        @include transform-origin(50% 50%);
-        @include background-size(cover);
-        background-image: url(get-resource-path('images/loading.png'));
-        background-position: center;
-        content: '';
-        position: absolute;
-        margin-top: -15px;
-        margin-left: -15px;
-        top: 50%;
-        left: 50%;
-        width: 41px;
-        height: 41px;
-    }
+    content: '';
+    position: absolute;
+    margin-top: -15px;
+    margin-left: -15px;
+    top: 50%;
+    left: 50%;
+    width: 41px;
+    height: 41px;
   }
+}
 
 @mixin btn-border($background-color) {
-    background-color: $background-color;
-    border-color: $background-color !important;
-  
-    .x-btn-inner-default-toolbar-small {
-      color: $lightest-color;
+  background-color: $background-color;
+  border-color: $background-color !important;
+
+  .x-btn-inner-default-toolbar-small {
+    color: $lightest-color;
+  }
+
+  &:hover {
+    background-color: transparent;
+
+    .x-btn-inner-default-toolbar-small,
+    .x-btn-inner-default-small {
+      color: $background-color;
     }
-  
-    &:hover {
-      background-color: transparent;
-  
-      .x-btn-inner-default-toolbar-small,
-      .x-btn-inner-default-small {
-        color: $background-color;
-      }
-  
-      .x-btn-icon-el-default-small,
-      .x-btn-icon-el-default-toolbar-small {
-        color: $background-color;
-      }
+
+    .x-btn-icon-el-default-small,
+    .x-btn-icon-el-default-toolbar-small {
+      color: $background-color;
     }
   }
-  
-  .x-menu-header {
-    z-index: 0 !important;
-  }
-  
-  .x-css-shadow{
-    box-shadow: none !important;
-  }
-  
-  .shadow {
-    @include box-shadow(rgba(0,0,0,0.2) 0 1px 2px);
-  }
-  
-  .x-fa {
-    display: inline-block;
-  }
-  
-  .alignRight {
-    float: right;
-  }
-  
-  .boldFont {
-    font-weight: bold;
-  }
+}
+
+.x-menu-header {
+  z-index: 0 !important;
+}
+
+.x-css-shadow {
+  box-shadow: none !important;
+}
+
+.shadow {
+  @include box-shadow(rgba(0, 0, 0, 0.2) 0 1px 2px);
+}
+
+.x-fa {
+  display: inline-block;
+}
+
+.alignRight {
+  float: right;
+}
 
-  
+.boldFont {
+  font-weight: bold;
+}

+ 3 - 0
frontend/saas-web/app/util/FormUtil.js

@@ -110,6 +110,9 @@ Ext.define('saas.util.FormUtil', {
                                 
                                 var editor = c.editor;
                                 if(editor) {
+                                    Ext.applyIf(editor, {
+                                        selectOnFocus: true
+                                    });
                                     if(editor.xtype == 'numberfield') {
                                         Ext.applyIf(editor, {
                                             hideTrigger: true, // 隐藏trigger

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

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

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

@@ -68,6 +68,7 @@ Ext.define('saas.view.core.form.FormPanel', {
             text: '保存',
             handler: 'onSave',
             bind: {
+                hidden: '{'+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}',
                 // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
                 disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
             }

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

@@ -28,21 +28,25 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var id = viewModel.get(form._idField);
         var code = viewModel.get(form._codeField);
         if(id&&id.value!=0){
-            me.BaseUtil.request({
-                url: form._deleteUrl+id,
-                method: 'POST',
-            })
-            .then(function(localJson) {
-                if(localJson.success){
-                    var mainTab = Ext.getCmp('main-tab-panel');
-                    mainTab.getActiveTab().close();
-                    //解析参数
-                    showToast('删除成功');
+            deleteWarn(form._deleteMsg,function(btn){
+                if(btn == 'yes'){
+                    me.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            var mainTab = Ext.getCmp('main-tab-panel');
+                            mainTab.getActiveTab().close();
+                            //解析参数
+                            showToast('删除成功');
+                        }
+                    })
+                    .catch(function(res) {
+                        console.error(res);
+                        showToast('删除失败: ' + res.message);
+                    });
                 }
-            })
-            .catch(function(res) {
-                console.error(res);
-                showToast('删除失败: ' + res.message);
             });
         }
     },
@@ -165,6 +169,18 @@ Ext.define('saas.view.core.form.FormPanelController', {
         })
         .catch(function(res) {
             console.error(res);
+            if(res.data) {
+                var id = localJson.data.id;
+                var code = localJson.data.code;
+                
+                form.initId = id;
+
+                var newId = form.xtype + '-' + id;
+                var newTitle = form._title + '(' + code + ')';
+
+                refreshTabTitle(newId, newTitle);
+                form.FormUtil.loadData(form);
+            }
             showToast('审核失败: ' + res.message);
         });
     },

+ 22 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -212,6 +212,28 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         me.callParent(arguments);
     },
     listeners: {
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            dockedItems = grid.getDockedItems(),
+            toolbar = dockedItems[0],
+            header = dockedItems[1],
+            pagingtoolbar = dockedItems[2];
+
+            var gridEl = grid.el.dom,
+            gridHeight = gridEl.getBoundingClientRect().height,
+            toolbarEl = toolbar.el.dom,
+            toolbarHeight = toolbarEl.getBoundingClientRect().height,
+            headerEl = header.el.dom,
+            headerHeight = headerEl.getBoundingClientRect().height,
+            pagingtoolbarEl = pagingtoolbar.el.dom,
+            pagingtoolbarHeight = pagingtoolbarEl.getBoundingClientRect().height;
+
+            var gridBodyHeight = gridHeight - toolbarHeight - headerHeight - pagingtoolbarHeight;
+
+            var pageSize = Math.floor(gridBodyHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
         itemClick: function(tableView, record, item, index, e, eOpts) {
             if(e.target.parentElement.classList.contains('x-querygrid-code-column')) {
                 var grid = tableView.up('grid'),

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

@@ -110,6 +110,13 @@ Ext.define('saas.view.core.query.QueryPanel', {
             }
         });
 
+        if(columns[columns.length - 1].flex != 1) {
+            columns.push({
+                flex: 1,
+                allowBlank: true
+            });
+        }
+
         me.queryGridConfig['columns']=columns;
         Ext.apply(queryGrid,me.queryGridConfig);
     },

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

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

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

@@ -100,7 +100,11 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 readOnly:true,
                 fieldLabel:'建账日期',
                 format:'Y-m-d H:i:s',
-                value:new Date()
+                listeners:{
+                    beforerender:function(d){
+                        d.setValue(new Date())
+                    }
+                }
             }]
         },
         productbrand:{

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

@@ -21,6 +21,7 @@ Ext.define('saas.view.document.kind.Kind', {
         xtype: 'segmentedbutton',
         reference: 'dataKind',
         value: 'customerkind',
+        name : 'segmentedbutton',
         bind:'{segmented}',
         items: [{
             text: '客户',
@@ -262,6 +263,8 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl: '/api/document/warehouse/save',
             delUrl: '/api/document/warehouse/delete'
         }
+    },
+    refresh:function(){
     }
 })
 

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

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

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

@@ -18,6 +18,7 @@ Ext.define('saas.view.document.product.FormPanel', {
     _openUrl:'/api/document/product/open',
     _closeUrl:'/api/document/product/close',
     _deleteUrl:'/api/document/product/delete/',
+    _deleteMsg:'删除的物料将不能恢复,请确认是否删除?',
     initId:0,
 
     codeInHeader: false,
@@ -160,7 +161,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         name : "pr_whcode", 
         bind : "{pr_whcode}", 
         fieldLabel : "仓库编号", 
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25, 
     }, {
         xtype : "textfield", 

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

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

+ 2 - 24
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -63,22 +63,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         xtype : "hidden", 
         name : "pu_delivery", 
         fieldLabel : "交货日期"
-    }, {
-        xtype : "hidden", 
-        name : "pu_buyerid", 
-        bind : "{pu_buyerid}", 
-        fieldLabel : "采购员ID"
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyercode", 
-        fieldLabel : "采购员编号", 
-        hidden:true,
-        columnWidth : 0
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyername", 
-        fieldLabel : "采购员名称"
-    }, {
+    },{
         xtype : "textfield", 
         name : "pu_shipaddresscode", 
         fieldLabel : "交货地址"
@@ -202,13 +187,6 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     var xr = (new Array(arr[1].length)).fill('0');
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join();
-                    return Ext.util.Format.number(v, format);
                 }
             }, 
             {
@@ -245,7 +223,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 }
             }, 
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "pd_taxtotal", 
                 width : 120.0,
                 editor : {

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

@@ -118,6 +118,8 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             from:'pr_detail',to:'pr_detail'
                         },{
                             from:'pr_spec',to:'pr_spec'
+                        },{
+                            from:'pr_purcprice',to:'pd_price'
                         }],
                         //联想设置
                         dbtpls:[{
@@ -128,6 +130,7 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                         defaultCondition: "pr_statuscode='OPEN'",
                         dbSearchFields:[{
                             emptyText:'输入物料编号、名称或规格',
+                            width: 200,
                             xtype : "textfield", 
                             name : "search", 
                             allowBlank : true, 
@@ -157,6 +160,10 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "text": "单位",
                             "dataIndex": "pr_spec",
                             "width": 100,
+                        }, {
+                            "text": "最新采购单价",
+                            "dataIndex": "pr_purcprice",
+                            "width": 0,
                         },{
                             "text": "仓库id",
                             "dataIndex": "pr_whid",

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

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

+ 12 - 6
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

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

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

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

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

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

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

@@ -66,7 +66,8 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         bind: '{pi_vendname}',
-        fieldLabel: '供应商名称'
+        fieldLabel: '供应商名称',
+        allowBlank : false,
     },{
         xtype : "datefield", 
         name : "pi_date", 
@@ -232,16 +233,32 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 text : "税率", 
                 dataIndex : "pd_taxrate",
                 editor : {
-                    xtype : "numberfield"
-                },   
-                width : 120.0, 
-                xtype : "numbercolumn"
+                    xtype : "numberfield",
+                    decimalPrecision: 0,
+                    minValue: 0,
+                    maxValue: 100
+                }
             },
             {
                 text : "未税金额", 
                 dataIndex : "pd_nettotal", 
-                xtype : "numbercolumn",
-                summaryType: 'sum'
+                editor : {
+                    xtype : "numberfield",
+                    decimalPrecision: 2
+                },
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                summaryType: 'sum',
+                summaryRenderer: function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
             },
             {
                 text : "采购单明细id", 
@@ -257,7 +274,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
-                flex:1,
                 format: '0000',
                 renderer: function(v) {
                     return v ? v : null;

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

@@ -21,7 +21,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                         addTitle: '供应商资料',
                         defaultCondition:"ve_statuscode='OPEN'",
                         dbfinds:[{
-                            from:'ve_id',to:'pi_vendid',ignore:true
+                            from:'id',to:'pi_vendid',ignore:true
                         },{
                             from:'ve_code',to:'pi_vendcode'
                         },{

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

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

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

@@ -203,7 +203,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 }
             }, 
             {
-                text : "未税金额", 
+                text : "未税金额", 
                 dataIndex : "sd_nettotal",
                 editor : {
                     xtype : "numberfield",

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

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

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

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

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

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

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

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

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

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

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

@@ -91,14 +91,15 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         defaultCondition:"pr_statuscode='OPEN'",
                         //窗口字段设置
                         dbSearchFields:[{
-                            emptyText:'输入仓库编号或名称',
+                            emptyText:'输入物料编号、名称或规格',
                             xtype : "textfield", 
-                            name : "name", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
                             allowBlank : true, 
-                            columnWidth : 0.25,
-                            getCondition:function(v){
-                                return "(upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
-                            }
+                            columnWidth : 0.25
                         }],
                         //窗口列设置
                         dbColumns:[{
@@ -189,14 +190,15 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         defaultCondition:"pr_statuscode='OPEN'",
                         //窗口字段设置
                         dbSearchFields:[{
-                            emptyText:'输入仓库编号或名称',
+                            emptyText:'输入物料编号、名称或规格',
                             xtype : "textfield", 
-                            name : "name", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
                             allowBlank : true, 
-                            columnWidth : 0.25,
-                            getCondition:function(v){
-                                return "(upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
-                            }
+                            columnWidth : 0.25
                         }],
                         //窗口列设置
                         dbColumns:[{

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 20 - 9
frontend/saas-web/app/view/sys/finish/DataList.js

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

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

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

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

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