Sfoglia il codice sorgente

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

hy 7 anni fa
parent
commit
d70d0293c5
76 ha cambiato i file con 522 aggiunte e 300 eliminazioni
  1. 1 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java
  2. 1 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java
  3. 2 1
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  4. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  5. 1 1
      applications/money/money-server/src/main/resources/application.yml
  6. 2 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java
  7. 2 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java
  8. 0 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java
  9. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java
  10. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  11. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  12. 5 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  13. 4 4
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  14. 1 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml
  15. 104 132
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  16. 1 1
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdIODetailDTO.java
  17. 24 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  18. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java
  19. 7 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  20. 28 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  21. 6 6
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  22. 2 1
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  23. 3 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  24. 1 1
      applications/storage/storage-server/src/main/resources/application.yml
  25. 8 9
      applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml
  26. 7 0
      applications/storage/storage-server/src/test/com/usoftchina/saas/storage/mapper/ProdIODetailMapperTest.java
  27. 2 2
      frontend/saas-web/app/model/purchase/purchasedetail.js
  28. 1 1
      frontend/saas-web/app/model/sale/ProdIODetail.js
  29. 1 1
      frontend/saas-web/app/model/sale/Saledetail.js
  30. 12 5
      frontend/saas-web/app/util/FormUtil.js
  31. 2 2
      frontend/saas-web/app/view/core/base/BasePanelController.js
  32. 5 3
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  33. 1 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  34. 7 6
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  35. 2 0
      frontend/saas-web/app/view/core/form/ConDateField.js
  36. 4 2
      frontend/saas-web/app/view/core/form/FormPanel.js
  37. 48 7
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  38. 22 1
      frontend/saas-web/app/view/core/form/field/DetailGridField.scss
  39. 1 1
      frontend/saas-web/app/view/core/query/QueryPanel.js
  40. 0 3
      frontend/saas-web/app/view/document/bom/FormPanel.js
  41. 0 5
      frontend/saas-web/app/view/document/customer/FormPanel.js
  42. 8 5
      frontend/saas-web/app/view/document/kind/ChildForm.js
  43. 1 1
      frontend/saas-web/app/view/document/product/FormController.js
  44. 0 2
      frontend/saas-web/app/view/document/product/FormPanel.js
  45. 1 5
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  46. 0 20
      frontend/saas-web/app/view/main/Main.scss
  47. 0 2
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  48. 0 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  49. 0 1
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  50. 0 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  51. 0 3
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  52. 0 1
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  53. 18 10
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  54. 9 0
      frontend/saas-web/app/view/purchase/purchase/FormPanelModel.js
  55. 3 3
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  56. 1 2
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  57. 9 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  58. 0 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  59. 9 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  60. 4 8
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  61. 29 0
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  62. 3 5
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  63. 2 4
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  64. 3 5
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  65. 0 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  66. 20 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js
  67. 0 3
      frontend/saas-web/app/view/stock/make/FormPanel.js
  68. 0 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  69. 20 1
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  70. 1 2
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  71. 20 3
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  72. 2 2
      frontend/saas-web/app/view/sys/finish/DataList.js
  73. 2 2
      frontend/saas-web/app/view/sys/maxnumbers/DataList.js
  74. 2 2
      frontend/saas-web/app/view/sys/messagelog/DataList.js
  75. 16 0
      frontend/saas-web/overrides/form/field/Date.js
  76. 10 0
      frontend/saas-web/overrides/i18n.js

+ 1 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface MaxnumbersMapper extends CommonBaseMapper<Maxnumbers>{
-    int countByExample(MaxnumbersExample example);
+    Long countByExample(MaxnumbersExample example);
 
     int deleteByExample(MaxnumbersExample example);
 

+ 1 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java

@@ -278,8 +278,8 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
     */
     private String getRulecode(Maxnumbers maxnumbers) {
         String rulecode = maxnumbers.getMn_leadcode();
-        Integer length = maxnumbers.getMn_number();
         String mn_rule = maxnumbers.getMn_rule();
+        mn_rule = mn_rule == null ? "" : mn_rule.toUpperCase();
         String date = "YYYYMM".equals(mn_rule) ? DateUtils.format(new Date(), "yyyyMM") :
                 DateUtils.format(new Date(), "yyyyMMdd");
         return rulecode += date;

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

@@ -6,8 +6,9 @@ import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
 @Data
-public class ProductDTO extends CommonBaseDTO implements Serializable {
+public class ProductDTO implements Serializable {
 
+    private Long id;
     private String pr_code;
     private String pr_detail;
     private String pr_spec;

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

@@ -26,6 +26,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
 
     @Override
     public boolean save(Bankinformation bankinformation){
+        bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
         if(bankinformation.getId() == 0){
             bankinformationMapper.insertSelective(bankinformation);
         }else{

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

@@ -46,7 +46,7 @@ eureka:
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
-  port: 8920
+  port: 8880
   tomcat:
     uri-encoding: UTF-8
 info:

+ 2 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java

@@ -30,6 +30,8 @@ public class PurchaseDetailDTO extends CommonBaseDTO implements Serializable{
 
     private Double pd_price;
 
+    private Double pd_taxprice;
+
     private Double pd_total;
 
     private Double pd_taxrate;

+ 2 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java

@@ -86,6 +86,8 @@ public class PurchaseListDTO extends CommonBaseDTO implements Serializable {
 
     private Double pd_price;
 
+    private Double pd_taxprice;
+
     private Double pd_total;
 
     private Double pd_taxrate;

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

@@ -15,8 +15,6 @@ public interface PurchasedetailMapper extends CommonBaseMapper<Purchase> {
 
     int updateByPrimaryKeySelective(PurchaseDetail record);
 
-    int updateByPrimaryKey(PurchaseDetail record);
-
     void batchInsert(List<PurchaseDetail> list);
 
     void batchUpdate(List<PurchaseDetail> list);

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java

@@ -26,6 +26,8 @@ public class PurchaseDetail extends CommonBaseEntity implements Serializable {
 
     private Double pd_price;
 
+    private Double pd_taxprice;
+
     private Double pd_total;
 
     private Double pd_taxrate;

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java

@@ -87,6 +87,8 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     private Double pd_price;
 
+    private Double pd_taxprice;
+
     private Double pd_total;
 
     private Double pd_taxrate;

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

@@ -161,6 +161,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             }
 
             baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
+            //计算金额,未税单价,未税金额等
+            calcProdInout(pi_id,pi_class);
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;

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

@@ -142,6 +142,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchasedetailMapper.batchInsert(insertDetails);
             }
             baseDTO = getBaseDTOById(pu_id);
+            //计算金额,未税单价,未税金额等
+            calcPurchase(pu_id);
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;
@@ -171,9 +173,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purchasedetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(pu_id);
-        //日志
+
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
+        //日志
         messageLogService.save(baseDTO);
         return baseDTO;
     }
@@ -501,7 +504,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     @Transactional
     private void calcPurchase(Long pu_id) {
-//        purchasedetailMapper.calcPurchase(pu_id);
+        purchasedetailMapper.calcPurchase(pu_id);
     }
 
 }

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

@@ -739,15 +739,15 @@
   </delete>
 
   <update id="calcProdIn">
-    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = pd_orderprice*pd_inqty,pd_nettotal = pd_netprice*pd_inqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    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>
 
   <update id="calcProdOut">
-    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = pd_orderprice*pd_outqty,pd_nettotal = pd_netprice*pd_outqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    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>

+ 1 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml

@@ -40,6 +40,7 @@
         <result column="PD_UNIT" property="pd_unit" jdbcType="VARCHAR" />
         <result column="PD_QTY" property="pd_qty" jdbcType="DOUBLE" />
         <result column="PD_PRICE" property="pd_price" jdbcType="DOUBLE" />
+        <result column="PD_TAXPRICE" property="pd_taxprice" jdbcType="DOUBLE" />
         <result column="PD_TOTAL" property="pd_total" jdbcType="DOUBLE" />
         <result column="PD_TAXTOTAL" property="pd_taxtotal" jdbcType="DOUBLE" />
         <result column="PD_ACCEPTQTY" property="pd_acceptqty" jdbcType="DOUBLE" />

+ 104 - 132
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -11,6 +11,7 @@
     <result column="PD_UNIT" property="pd_unit" jdbcType="VARCHAR" />
     <result column="PD_QTY" property="pd_qty" jdbcType="DOUBLE" />
     <result column="PD_PRICE" property="pd_price" jdbcType="DOUBLE" />
+    <result column="PD_TAXPRICE" property="pd_taxprice" jdbcType="DOUBLE" />
     <result column="PD_TOTAL" property="pd_total" jdbcType="DOUBLE" />
     <result column="PD_TAXRATE" property="pd_taxrate" jdbcType="DOUBLE" />
     <result column="PD_TAXTOTAL" property="pd_taxtotal" jdbcType="DOUBLE" />
@@ -60,7 +61,7 @@
     </association>
   </resultMap>
   <sql id="Base_Column_List" >
-    PD_ID, PD_PUID, PD_CODE, PD_DETNO, PD_PRODID, PD_PRODCODE, PD_UNIT, PD_QTY, PD_PRICE,
+    PD_ID, PD_PUID, PD_CODE, PD_DETNO, PD_PRODID, PD_PRODCODE, PD_UNIT, PD_QTY, PD_PRICE,PD_TAXPRICE,
     PD_TOTAL, PD_TAXRATE,PD_TAXTOTAL, PD_ACCEPTQTY, PD_DELIVERY, PD_SALECODE, PD_SALEDETNO, PD_SDID,
     companyId, updaterId, updateTime, pd_text1, pd_text2, pd_text3, pd_text4, pd_text5,
     pd_yqty
@@ -75,183 +76,180 @@
     delete from purchasedetail
     where PD_ID = #{id}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
-    insert into purchasedetail (PD_PUID, PD_CODE,
-    PD_DETNO, PD_PRODID, PD_PRODCODE,
-    PD_UNIT, PD_QTY, PD_PRICE,
-    PD_TOTAL, PD_TAXTOTAL, PD_ACCEPTQTY,
-    PD_DELIVERY, PD_SALECODE, PD_SALEDETNO,
-    PD_SDID, companyId, updaterId,
-    updateTime, pd_text1, pd_text2,
-    pd_text3, pd_text4, pd_text5,
-    pd_yqty)
-    values (#{pdPuid,jdbcType=INTEGER}, #{pdCode,jdbcType=VARCHAR},
-    #{pdDetno,jdbcType=INTEGER}, #{pdProdid,jdbcType=INTEGER}, #{pdProdcode,jdbcType=VARCHAR},
-    #{pdUnit,jdbcType=VARCHAR}, #{pdQty,jdbcType=DOUBLE}, #{pdPrice,jdbcType=DOUBLE},
-    #{pdTotal,jdbcType=DOUBLE}, #{pdTaxtotal,jdbcType=DOUBLE}, #{pdAcceptqty,jdbcType=DOUBLE},
-    #{pdDelivery,jdbcType=DOUBLE}, #{pdSalecode,jdbcType=VARCHAR}, #{pdSaledetno,jdbcType=INTEGER},
-    #{pdSdid,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
-    #{updateTime,jdbcType=TIMESTAMP}, #{pdText1,jdbcType=VARCHAR}, #{pdText2,jdbcType=VARCHAR},
-    #{pdText3,jdbcType=VARCHAR}, #{pdText4,jdbcType=VARCHAR}, #{pdText5,jdbcType=VARCHAR},
-    #{pdYqty,jdbcType=DOUBLE})
-  </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
+
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into purchasedetail
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="pdPuid != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="PD_ID != null">
+        PD_ID,
+      </if>
+      <if test="PD_PUID != null">
         PD_PUID,
       </if>
-      <if test="pdCode != null" >
+      <if test="PD_CODE != null">
         PD_CODE,
       </if>
-      <if test="pdDetno != null" >
+      <if test="PD_DETNO != null">
         PD_DETNO,
       </if>
-      <if test="pdProdid != null" >
+      <if test="PD_PRODID != null">
         PD_PRODID,
       </if>
-      <if test="pdProdcode != null" >
+      <if test="PD_PRODCODE != null">
         PD_PRODCODE,
       </if>
-      <if test="pdUnit != null" >
+      <if test="PD_UNIT != null">
         PD_UNIT,
       </if>
-      <if test="pdQty != null" >
+      <if test="PD_QTY != null">
         PD_QTY,
       </if>
-      <if test="pdPrice != null" >
+      <if test="PD_YQTY != null">
+        PD_YQTY,
+      </if>
+      <if test="PD_PRICE != null">
         PD_PRICE,
       </if>
-      <if test="pdTotal != null" >
+      <if test="PD_TAXPRICE != null">
+        PD_TAXPRICE,
+      </if>
+      <if test="PD_TOTAL != null">
         PD_TOTAL,
       </if>
-      <if test="PD_TAXRATE != null" >
+      <if test="PD_TAXRATE != null">
         PD_TAXRATE,
       </if>
-      <if test="pdTaxtotal != null" >
+      <if test="PD_TAXTOTAL != null">
         PD_TAXTOTAL,
       </if>
-      <if test="pdAcceptqty != null" >
+      <if test="PD_ACCEPTQTY != null">
         PD_ACCEPTQTY,
       </if>
-      <if test="pdDelivery != null" >
+      <if test="PD_DELIVERY != null">
         PD_DELIVERY,
       </if>
-      <if test="pdSalecode != null" >
+      <if test="PD_SALECODE != null">
         PD_SALECODE,
       </if>
-      <if test="pdSaledetno != null" >
+      <if test="PD_SALEDETNO != null">
         PD_SALEDETNO,
       </if>
-      <if test="pdSdid != null" >
+      <if test="PD_SDID != null">
         PD_SDID,
       </if>
-      <if test="companyId != null" >
+      <if test="companyId != null">
         companyId,
       </if>
-      <if test="updaterId != null" >
+      <if test="updaterId != null">
         updaterId,
       </if>
-      <if test="updateTime != null" >
+      <if test="updateTime != null">
         updateTime,
       </if>
-      <if test="pdText1 != null" >
+      <if test="pd_text1 != null">
         pd_text1,
       </if>
-      <if test="pdText2 != null" >
+      <if test="pd_text2 != null">
         pd_text2,
       </if>
-      <if test="pdText3 != null" >
+      <if test="pd_text3 != null">
         pd_text3,
       </if>
-      <if test="pdText4 != null" >
+      <if test="pd_text4 != null">
         pd_text4,
       </if>
-      <if test="pdText5 != null" >
+      <if test="pd_text5 != null">
         pd_text5,
       </if>
-      <if test="pdYqty != null" >
-        pd_yqty,
-      </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="pdPuid != null" >
-        #{pdPuid,jdbcType=INTEGER},
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+      <if test="PD_PUID != null">
+        #{PD_PUID,jdbcType=INTEGER},
+      </if>
+      <if test="PD_CODE != null">
+        #{PD_CODE,jdbcType=VARCHAR},
       </if>
-      <if test="pdCode != null" >
-        #{pdCode,jdbcType=VARCHAR},
+      <if test="PD_DETNO != null">
+        #{PD_DETNO,jdbcType=INTEGER},
       </if>
-      <if test="pdDetno != null" >
-        #{pdDetno,jdbcType=INTEGER},
+      <if test="PD_PRODID != null">
+        #{PD_PRODID,jdbcType=INTEGER},
       </if>
-      <if test="pdProdid != null" >
-        #{pdProdid,jdbcType=INTEGER},
+      <if test="PD_PRODCODE != null">
+        #{PD_PRODCODE,jdbcType=VARCHAR},
       </if>
-      <if test="pdProdcode != null" >
-        #{pdProdcode,jdbcType=VARCHAR},
+      <if test="PD_UNIT != null">
+        #{PD_UNIT,jdbcType=VARCHAR},
       </if>
-      <if test="pdUnit != null" >
-        #{pdUnit,jdbcType=VARCHAR},
+      <if test="PD_QTY != null">
+        #{PD_QTY,jdbcType=INTEGER},
       </if>
-      <if test="pdQty != null" >
-        #{pdQty,jdbcType=DOUBLE},
+      <if test="PD_YQTY != null">
+        #{PD_YQTY,jdbcType=INTEGER},
       </if>
-      <if test="pdPrice != null" >
-        #{pdPrice,jdbcType=DOUBLE},
+      <if test="PD_PRICE != null">
+        #{PD_PRICE,jdbcType=DOUBLE},
       </if>
-      <if test="pdTotal != null" >
-        #{pdTotal,jdbcType=DOUBLE},
+      <if test="PD_TAXPRICE != null">
+        #{PD_TAXPRICE,jdbcType=DOUBLE},
       </if>
-      <if test="PD_TAXRATE != null" >
+      <if test="PD_TOTAL != null">
+        #{PD_TOTAL,jdbcType=DOUBLE},
+      </if>
+      <if test="PD_TAXRATE != null">
         #{PD_TAXRATE,jdbcType=DOUBLE},
       </if>
-      <if test="pdTaxtotal != null" >
-        #{pdTaxtotal,jdbcType=DOUBLE},
+      <if test="PD_TAXTOTAL != null">
+        #{PD_TAXTOTAL,jdbcType=DOUBLE},
       </if>
-      <if test="pdAcceptqty != null" >
-        #{pdAcceptqty,jdbcType=DOUBLE},
+      <if test="PD_ACCEPTQTY != null">
+        #{PD_ACCEPTQTY,jdbcType=DOUBLE},
       </if>
-      <if test="pdDelivery != null" >
-        #{pdDelivery,jdbcType=TIMESTAMP},
+      <if test="PD_DELIVERY != null">
+        #{PD_DELIVERY,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdSalecode != null" >
-        #{pdSalecode,jdbcType=VARCHAR},
+      <if test="PD_SALECODE != null">
+        #{PD_SALECODE,jdbcType=VARCHAR},
       </if>
-      <if test="pdSaledetno != null" >
-        #{pdSaledetno,jdbcType=INTEGER},
+      <if test="PD_SALEDETNO != null">
+        #{PD_SALEDETNO,jdbcType=INTEGER},
       </if>
-      <if test="pdSdid != null" >
-        #{pdSdid,jdbcType=INTEGER},
+      <if test="PD_SDID != null">
+        #{PD_SDID,jdbcType=INTEGER},
       </if>
-      <if test="companyId != null" >
+      <if test="companyId != null">
         #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterId != null" >
+      <if test="updaterId != null">
         #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updateTime != null" >
+      <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdText1 != null" >
-        #{pdText1,jdbcType=VARCHAR},
-      </if>
-      <if test="pdText2 != null" >
-        #{pdText2,jdbcType=VARCHAR},
+      <if test="pd_text1 != null">
+        #{pd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pdText3 != null" >
-        #{pdText3,jdbcType=VARCHAR},
+      <if test="pd_text2 != null">
+        #{pd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pdText4 != null" >
-        #{pdText4,jdbcType=VARCHAR},
+      <if test="pd_text3 != null">
+        #{pd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pdText5 != null" >
-        #{pdText5,jdbcType=VARCHAR},
+      <if test="pd_text4 != null">
+        #{pd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pdYqty != null" >
-        #{pdYqty,jdbcType=DOUBLE},
+      <if test="pd_text5 != null">
+        #{pd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
+
+
+
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     update purchasedetail
     <set >
@@ -334,38 +332,11 @@
     </set>
     where PD_ID = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
-    update purchasedetail
-    set PD_PUID = #{pdPuid,jdbcType=INTEGER},
-    PD_CODE = #{pdCode,jdbcType=VARCHAR},
-    PD_DETNO = #{pdDetno,jdbcType=INTEGER},
-    PD_PRODID = #{pdProdid,jdbcType=INTEGER},
-    PD_PRODCODE = #{pdProdcode,jdbcType=VARCHAR},
-    PD_UNIT = #{pdUnit,jdbcType=VARCHAR},
-    PD_QTY = #{pdQty,jdbcType=DOUBLE},
-    PD_PRICE = #{pdPrice,jdbcType=DOUBLE},
-    PD_TOTAL = #{pdTotal,jdbcType=DOUBLE},
-    PD_TAXTOTAL = #{pdTaxtotal,jdbcType=DOUBLE},
-    PD_ACCEPTQTY = #{pdAcceptqty,jdbcType=DOUBLE},
-    PD_DELIVERY = #{pdDelivery,jdbcType=DOUBLE},
-    PD_SALECODE = #{pdSalecode,jdbcType=VARCHAR},
-    PD_SALEDETNO = #{pdSaledetno,jdbcType=INTEGER},
-    PD_SDID = #{pdSdid,jdbcType=INTEGER},
-    companyId = #{companyId,jdbcType=INTEGER},
-    updaterId = #{updaterId,jdbcType=INTEGER},
-    updateTime = #{updateTime,jdbcType=TIMESTAMP},
-    pd_text1 = #{pdText1,jdbcType=VARCHAR},
-    pd_text2 = #{pdText2,jdbcType=VARCHAR},
-    pd_text3 = #{pdText3,jdbcType=VARCHAR},
-    pd_text4 = #{pdText4,jdbcType=VARCHAR},
-    pd_text5 = #{pdText5,jdbcType=VARCHAR},
-    pd_yqty = #{pdYqty,jdbcType=DOUBLE}
-    where PD_ID = #{id,jdbcType=INTEGER}
-  </update>
+
   <insert id="batchInsert" parameterType="java.util.List" >
     insert into purchasedetail ( PD_PUID, PD_CODE,
     PD_DETNO, PD_PRODID, PD_PRODCODE,
-    PD_UNIT, PD_QTY, PD_PRICE,
+    PD_UNIT, PD_QTY, PD_PRICE,PD_TAXPRICE,
     PD_TOTAL,PD_TAXRATE, PD_TAXTOTAL, PD_ACCEPTQTY,
     PD_DELIVERY, PD_SALECODE, PD_SALEDETNO,
     PD_SDID, companyId, updaterId,
@@ -377,7 +348,7 @@
       (
       #{item.pd_puid,jdbcType=INTEGER}, #{item.pd_code,jdbcType=VARCHAR},
       #{item.pd_detno,jdbcType=INTEGER}, #{item.pd_prodid,jdbcType=INTEGER}, #{item.pd_prodcode,jdbcType=VARCHAR},
-      #{item.pd_unit,jdbcType=VARCHAR}, #{item.pd_qty,jdbcType=DOUBLE}, #{item.pd_price,jdbcType=DOUBLE},
+      #{item.pd_unit,jdbcType=VARCHAR}, #{item.pd_qty,jdbcType=DOUBLE}, #{item.pd_price,jdbcType=DOUBLE},#{item.pd_taxprice,jdbcType=DOUBLE},
       #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE}, #{item.pd_taxtotal,jdbcType=DOUBLE}, #{item.pd_acceptqty,jdbcType=DOUBLE},
       #{item.pd_delivery,jdbcType=DOUBLE}, #{item.pd_salecode,jdbcType=VARCHAR}, #{item.pd_saledetno,jdbcType=INTEGER},
       #{item.pd_sdid,jdbcType=INTEGER}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
@@ -398,6 +369,7 @@
       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},
@@ -437,10 +409,10 @@
 
 
   <update id="calcPurchase" parameterType="long" >
-    update purchasedetail set pd_netprice = PD_PRICE/(1+pd_taxrate/100) where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchasedetail set pd_total = PD_PRICE*pd_qty,pd_nettotal = pd_netprice*pd_inqty where pd_puid = #{pu_id,jdbcType=INTEGER};
-    update purchase set pu_total = (select sum(pd_total) from prodiodetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
-    update purchase set p_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_puid = #{pi_id,jdbcType=INTEGER} ) where pu_id = #{pu_id,jdbcType=INTEGER};
+    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>
 
 

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

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

+ 24 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -163,6 +163,30 @@ public class SaleController {
         return Result.success(baseDTO);
     }
 
+    /**
+     * 出入库单批量关闭
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchClose")
+    public Result batchClose(@RequestBody BatchDealBaseDTO baseDTOs) {
+        saleService.batchClose(baseDTOs);
+        return Result.success();
+    }
+
+    /**
+     * 出入库单批量开启
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchOpen")
+    public Result batchOpen(@RequestBody BatchDealBaseDTO baseDTOs) {
+       saleService.batchOpen(baseDTOs);
+       return Result.success();
+    }
+
     @GetMapping("/test")
     public String test() {
         return "配置构建success-1";

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

@@ -40,4 +40,8 @@ public interface SaleService {
     void open(long id);
 
     DocBaseDTO turnOut(Long id);
+
+    void batchClose(BatchDealBaseDTO baseDTOs);
+
+    void batchOpen(BatchDealBaseDTO baseDTOs);
 }

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

@@ -126,6 +126,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             if (insertDetails.size()>0) {
                 prodIODetailMapper.batchInsert(insertDetails);
             }
+
+            ProdInOut prodInOutNow = checkAndReturnOrder(pi_id);
+            //更新明细金额等
+            setTotal(prodInOutNow);
             baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
             //日志记录
             messageLogService.save(baseDTO);
@@ -139,6 +143,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             detail.setPd_piid(pi_id);
             detail.setPd_inoutno(pi_inoutno);
             detail.setPd_piclass(prodInOut.getPi_class());
+            detail.setCompanyId(companyId);
+            detail.setCreateTime(new Date());
+            detail.setPd_yqty(0.0);
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
                 insertDetails.add(detail);
             } else {

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

@@ -135,6 +135,7 @@ public class SaleServiceImpl implements SaleService{
                 detail.setSd_said(sa_id);
                 detail.setSd_code(sa_code);
                 detail.setSd_yqty(0.0);
+                detail.setCompanyId(companyId);
                 insertDetails.add(detail);
             }
             //插入从表
@@ -478,6 +479,33 @@ public class SaleServiceImpl implements SaleService{
          return baseDTO;
     }
 
+    @Override
+    public void batchClose(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        for (DocBaseDTO baseDTO : baseDTOs.getBaseDTOs()) {
+            if (!StringUtils.isEmpty(baseDTO.getId())) {
+                close(baseDTO.getId());
+            }
+        }
+    }
+
+    @Override
+    public void batchOpen(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        for (DocBaseDTO baseDTO : baseDTOs.getBaseDTOs()) {
+            if (!StringUtils.isEmpty(baseDTO.getId())) {
+                open(baseDTO.getId());
+            }
+        }
+
+    }
+
     //更新最新销售总额
     private void updateTotal(Long id) {
         if (null == id) {

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

@@ -763,16 +763,16 @@ where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pd_pi
 
   <update id="updatePDSaleIN" parameterType="long">
    update prodiodetail set
-   pd_total=IFNULL(pd_inqty,0)*IFNULL(pd_sendprice,0),
-   pd_netprice = IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),
-   pd_nettotal = (IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_inqty,0)
+   pd_total=round(IFNULL(pd_inqty,0)*IFNULL(pd_sendprice,0),2),
+   pd_netprice = round(IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),2),
+   pd_nettotal = round((IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_inqty,0),2)
    where pd_piid=#{id}
   </update>
   <update id="updatePDSaleOut" parameterType="long">
     update prodiodetail set
-    pd_total=IFNULL(pd_outqty,0)*IFNULL(pd_sendprice,0),
-    pd_netprice = IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100),
-    pd_nettotal = (IFNULL(pd_sendprice,0)/(1+IFNULL(pd_taxrate,0)/100))*IFNULL(pd_outqty,0)
+    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)
     where pd_piid=#{id}
   </update>
 </mapper>

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

@@ -51,7 +51,8 @@
     </resultMap>
 
     <select id="selectPurchaseListByCondition" resultMap="BaseResultMap">
-        select  *  from sale left join saledetail on sa_id=sd_said
+        select  *  from sale left join saledetail on sa_id=sd_said left join product
+        on sd_prodid = pr_id and sale.companyId = product.companyid
         <where>
             <if test="con != null">
                 ${con}

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

@@ -156,6 +156,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             }
 
             baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
+            //计算金额,未税单价,未税金额等
+            calcProdInout(pi_id,pi_class);
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;
@@ -464,6 +466,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     private void calcProdInout(Long pi_id, String pi_class) {
+        Integer id = pi_id.intValue();
         if ("其它入库单".equals(pi_class)) {
             prodIODetailMapper.calcProdIn(pi_id);
         } else if ("其它出库单".equals(pi_class)) {

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

@@ -9,7 +9,7 @@ spring:
       password: select111***
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: root
     password: select111***
     hikari:

+ 8 - 9
applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -721,11 +721,10 @@
   </update>
 
   <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
-
-update prodiodetail a
-set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_ioid,sum(pd_outqty) pd_outqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
-and pi_puid=#{id,jdbcType=INTEGER}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
-where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
+  update prodiodetail a
+  set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_ioid,sum(pd_outqty) pd_outqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
+  and pi_puid=#{id,jdbcType=INTEGER}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+  where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
   </update>
 
 
@@ -740,15 +739,15 @@ where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEG
   </delete>
 
   <update id="calcProdIn">
-    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = pd_orderprice*pd_inqty,pd_nettotal = pd_netprice*pd_inqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    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>
 
   <update id="calcProdOut">
-    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
-    update prodiodetail set pd_total = pd_orderprice*pd_outqty,pd_nettotal = pd_netprice*pd_outqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    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>

+ 7 - 0
applications/storage/storage-server/src/test/com/usoftchina/saas/storage/mapper/ProdIODetailMapperTest.java

@@ -80,4 +80,11 @@ public class ProdIODetailMapperTest {
     public void selectByFK() throws Exception {
     }
 
+    @Test
+    public void calcProdIn() throws Exception {
+//        prodIODetailMapper.calcProdIn(486);
+
+    }
+
+
 }

+ 2 - 2
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -5,8 +5,8 @@ Ext.define('saas.model.purchase.Purchasedetail', {
         { name: 'pd_detno', type: 'int' },
         { name: 'id', type: 'int' },
         { name: 'pd_prodcode', type: 'string' },
-        { name: 'pd_qty', type: 'int' },
-        { name: 'pd_yqty', type: 'int' },
+        { name: 'pd_qty', type: 'float' },
+        { name: 'pd_yqty', type: 'float' },
         { name: 'pd_price', type: 'float' },
         { name: 'pd_taxrate', type: 'float' },
         { name: 'pd_total', type: 'float' },

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

@@ -37,5 +37,5 @@ Ext.define('saas.model.sale.ProdIODetail', {
         { name: 'pd_ioid', type: 'int' },
     ],
     //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'product'}]
+    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
 });

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

@@ -15,5 +15,5 @@ Ext.define('saas.model.sale.Saledetail', {
         { name: 'sd_pucode', type: 'string' }
     ],
     //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'product'}]
+    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
 });

+ 12 - 5
frontend/saas-web/app/util/FormUtil.js

@@ -37,7 +37,9 @@ Ext.define('saas.util.FormUtil', {
                     Ext.Array.each(items, function(item) {
 
                         if(item.xtype == 'datefield') {
-                            item.format = 'Y-m-d H:i:s'
+                            Ext.applyIf(item, {
+                                format: 'Y-m-d'
+                            });
                         }
 
                         if(item.xtype == 'numberfield') {
@@ -87,8 +89,12 @@ Ext.define('saas.util.FormUtil', {
                                 }
 
                                 if(c.xtype == 'datecolumn') {
-                                    Ext.apply(c.xtype, {
-                                        format: 'Y-m-d H:i:s'
+                                    Ext.applyIf(c, {
+                                        format: 'Y-m-d'
+                                    });
+                                }else if(c.xtype == 'numbercolumn') {
+                                    Ext.applyIf(c, {
+                                        align: 'end'
                                     });
                                 }
                                 
@@ -101,14 +107,15 @@ Ext.define('saas.util.FormUtil', {
                                         });
                                     }else if(editor.xtype == 'datefield') {
                                         Ext.apply(editor, {
-                                            format: 'Y-m-d H:i:s'
+                                            format: 'Y-m-d'
                                         });
                                     }
                                 }
                             });
 
                             columns.push({
-                                flex: 1
+                                flex: 1,
+                                allowBlank: true
                             });
 
                             cnames.push(item.detnoColumn);

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

@@ -102,12 +102,12 @@ Ext.define('saas.view.core.base.BasePanelController', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

+ 5 - 3
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -95,11 +95,13 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                 if(me.belong=='grid'){
                     for (let index = 0; index < dbfinds.length; index++) {
                         var item = dbfinds[index];
-                        var rec = me.dbfindtrigger.column.ownerCt.ownerCt.selModel.getLastSelected();
+                        var mainGrid = me.dbfindtrigger.column.ownerCt.ownerCt;
+                        var rec = mainGrid.selModel.getLastSelected();
                         if(rec){
                             var nowRec = me.dbfindtrigger.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
                             nowRec.set(item.to,record.get(item.from));
                             //me.column.getEditor().setValue(record.get(item.from));
+                            mainGrid.up('detailGridField').fireEvent('edit');
                         }
                     }
                 }else if(me.belong=='form'){
@@ -202,12 +204,12 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

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

@@ -15,7 +15,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
             fields: ['display','value'],
             data : []
         });
-        this.callParent();
+        me.callParent();
     },
     //输入值之后进行模糊查询
     doQuery: function(queryString, forceAll, rawQuery) {

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

@@ -112,12 +112,12 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                             var selectRecordArr = grid.selectRecordArr;
                             var dbfinds = grid.dbfinds;
                             //点开放大镜的行
-                            var rec = grid.dbfindtrigger.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var mainGrid = grid.dbfindtrigger.column.ownerCt.ownerCt;
-                            Ext.Array.each(selectRecordArr,function(record,x) {
+                            var rec = mainGrid.selModel.getLastSelected();
+                            Ext.Array.each(selectRecordArr,function(record,index) {
                                 Ext.Array.each(dbfinds,function(dbfind) {
                                     if(rec){
-                                        var nowRec = grid.dbfindtrigger.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+                                        var nowRec = mainGrid.store.getData().getByKey(rec.id);
                                         nowRec.set(dbfind.to,record.get(dbfind.from));
                                     }
                                 });
@@ -125,13 +125,14 @@ 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&&x!=selectRecordArr.length-1){//添加下一行
+                                if(!rec&&index!=selectRecordArr.length-1){//添加下一行
                                     var data = {};
                                     data[mainGrid.ownerCt.detnoColumn] = index + 2;
                                     mainGrid.store.insert(index+1, data);
                                     rec = mainGrid.store.data.getAt(index+1);
                                 }
                             });
+                            mainGrid.up('detailGridField').fireEvent('edit');
                             grid.ownerCt.close();
                         }
                     }])
@@ -344,12 +345,12 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

+ 2 - 0
frontend/saas-web/app/view/core/form/ConDateField.js

@@ -53,6 +53,7 @@ Ext.define('saas.view.core.form.ConDateField', {
             xtype: 'datefield',
             name: me.name + '_from',
             format: 'Y-m-d',
+            formatText: '',
             allowBlank: allowBlank,
             flex: 1,
             fieldStyle: me.fieldStyle,
@@ -86,6 +87,7 @@ Ext.define('saas.view.core.form.ConDateField', {
             name: me.name + '_to',
             allowBlank: allowBlank,
             format: 'Y-m-d',
+            formatText: '',
             flex: 1,
             fieldStyle: me.fieldStyle,
             listeners: {

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

@@ -85,7 +85,8 @@ Ext.define('saas.view.core.form.FormPanel', {
                     }
                 }, {
                     xtype: 'tbtext',
-                    html: '已审核',
+                    // html: '已审核',
+                    html: auditTexts.auditText,
                     cls: 'x-audited',
                     hidden: true,
                     bind: {
@@ -124,7 +125,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                     xtype: 'button',
                     text: '删除',
                     bind: {
-                        hidden: '{deleteHidden}'
+                        hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + auditTexts.auditCode + '"}'
                     },
                     handler: 'delete'
                 }, {
@@ -268,6 +269,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                 store = detail.detailStore;
 
             if (detailData) {
+                store.removeAll();
                 store.add(detailData);
             }
         }

+ 48 - 7
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -27,6 +27,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     showIndex: true,
     configUrl: '',
     editable: true,
+    allowEmpty: false, // 校验时只校验dirty数据
 
     initComponent: function() {
         var me = this;
@@ -41,17 +42,28 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         };
 
         Ext.apply(me, {
-            viewConfig: {
+            normalViewConfig: {
                 deferEmptyText: false,
                 emptyText: '无数据'
             },
+            lockedGridConfig: {
+                // scrollable: {
+                //     x: false,
+                //     y: true
+                // }
+            },
             lockedViewConfig: {
+                // scrollable: false,
+                scrollable: {
+                    x: false,
+                    y: true
+                },
                 deferEmptyText: false,
                 emptyText: '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>',
             },
             listeners: {
                 edit: function() {
-                    me.fireEvent('validChange');
+                    this.fireEvent('validChange');
                 },
                 itemmouseenter: function(view, record, item, index, e, eOpts) {
                     if(!view.up('detailGridField').editable) {
@@ -86,7 +98,8 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                     }else if(target.classList.contains('fa-plus')) {
                         me.addDetail(detno);
                     }
-                }
+                },
+                scope: me
             }
         });
         me.callParent(arguments);
@@ -303,9 +316,10 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
      */
     isValid: function() {
         var me = this,
+        allowEmpty = me.allowEmpty;
         columns = me.columns,
-        dirtyData = me.getDirtyData(),
-        valid = true;
+        data = allowEmpty ? me.getDirtyData() : me.getAllData(),
+        valid = allowEmpty;
 
         // 判断列必填
         a:
@@ -316,8 +330,9 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             var isValid = c.isValid;
             
             b:
-            for(var j = 0; j < dirtyData.length; j++) {
-                var d = dirtyData[j];
+            for(var j = 0; j < data.length; j++) {
+                valid = true;
+                var d = data[j];
                 var value = d[cname];
 
                 if(typeof isValid == 'function') {
@@ -338,6 +353,32 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         return valid;
     },
 
+    /**
+     * 获得所有数据
+     */
+    getAllData: function() {
+        var me = this,
+        store = me.getStore(),
+        storeData = store.getData().items,
+        allData = [];
+
+        Ext.Array.each(storeData, function(item){
+            var d = Object.assign({}, item.data);
+
+            if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
+                d.id = 0;
+            }
+            for(k in d) {
+                if(Ext.isDate(d[k])) {
+                    d[k] = Ext.Date.format(d[k], 'Y-m-d H:i:s');
+                }
+            }
+            allData.push(d);
+        });
+
+        return allData;
+    },
+
     /**
      * 获得已修改的数据
      */

+ 22 - 1
frontend/saas-web/app/view/core/form/field/DetailGridField.scss

@@ -1,9 +1,30 @@
 .x-detailgridfield {
 
     .x-grid-view {
-        
+
         .x-grid-empty {
             padding: 8px 10px;
         }
     }
+}
+
+.x-column-header{
+    text-align: center !important;
+    border-width: 1px;
+}
+.x-column-header .x-column-header-text {
+    font: "microsoft yahei";
+    text-align: center;
+    font-size:14px;
+    font-weight: 500;
+}
+.x-grid-necessary .x-column-header-text:before{
+    content: '*';
+    font-size: 130%;
+    color: #ff0000;
+    width: 5px;
+    height: 5px;
+    margin-top: 4px;
+    margin-left: -10px;
+    position: absolute;
 }

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

@@ -222,7 +222,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
         }else if(xtype == 'condatefield') {
             var from = value.from,
             to = value.to;

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

@@ -47,18 +47,15 @@ Ext.define('saas.view.document.bom.FormPanel', {
         name: 'bo_statuscode',
         fieldLabel: '状态码'
     },{
-        format : "Y-m-d H:i:s",
         xtype : "datefield", 
         name : "createTime", 
         fieldLabel : "创建时间"
     },{  
-        format : "Y-m-d H:i:s",
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间"
     }, {
         xtype : "detailGridField", 
-        detnoColumn:  'bd_detno',
         storeModel:'saas.model.document.bomdetail',
         deleteDetailUrl:'/api/document/bom/deleteDetail/',
         columns : [

+ 0 - 5
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -77,14 +77,12 @@ Ext.define('saas.view.document.customer.FormPanel', {
             this.dialog.show();
         }
     },{
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "createTime", 
         fieldLabel : "创建时间", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "cu_begindate", 
         fieldLabel : "期初日期", 
@@ -132,7 +130,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{  
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 
@@ -141,7 +138,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
     }, {
         height: 169,
         xtype : "detailGridField", 
-        detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
         deleteDetailUrl:'/api/document/customer/deletecontact/',
         columns : [
@@ -233,7 +229,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
     } ,{
         height: 169,
         xtype : "detailGridField", 
-        detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
         deleteDetailUrl:'/api/document/customer/deleteaddress/',
         columns : [

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

@@ -35,7 +35,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 name:'ck_name',
                 allowBlank:false,
-                fieldLabel:'类型'
+                fieldLabel:'客户类型'
             }]
         },
         vendorkind:{
@@ -46,7 +46,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 name:'vk_name',
                 allowBlank:false,
-                fieldLabel:'类型'
+                fieldLabel:'供应商类型'
             }]
         },
         productkind:{
@@ -57,7 +57,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 name:'pt_name',
                 allowBlank:false,
-                fieldLabel:'类型'
+                fieldLabel:'物料类型'
             }]
         },
         bankinformation:{
@@ -94,7 +94,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 name:'pb_name',
                 allowBlank:false,
-                fieldLabel:'类型'
+                fieldLabel:'物料品牌'
             }]
         },  
         productunit:{
@@ -238,6 +238,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 var dataField = form.down('[name='+name+']');
                 if(dataField&&dataField.value){
                     params[name] = dataField.value;
+                    params._value = dataField.value;
                 }
             }
         });
@@ -257,7 +258,9 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                     grid.store.load();
                 }
                 if(combo){
-                    combo.store.load();
+                    combo.store.load(function() {
+                        combo.setValue(params._value);
+                    });
                 }
                 form.ownerCt.close();
             }

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

@@ -65,7 +65,7 @@ Ext.define('saas.view.document.product.FormController', {
 
                 }
             },
-            //从表单选放大镜赋值关系 以及 tpl模板
+            // 仓库编号
             'dbfindtrigger[name=pr_whcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{

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

@@ -162,14 +162,12 @@ Ext.define('saas.view.document.product.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "createTime", 
         fieldLabel : "创建时间", 
         allowBlank : true, 
         columnWidth : 0.25
     },{  
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 

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

@@ -76,14 +76,12 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             this.dialog.show();
         }
     },{
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "createTime", 
         fieldLabel : "创建时间", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "ve_begindate", 
         fieldLabel : "期初日期", 
@@ -114,7 +112,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         xtype : "numberfield", 
         name : "ve_taxrate", 
         fieldLabel : "税率", 
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25   
     },{
         // xtype : "numberfield", 
@@ -131,7 +129,6 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     },{  
-        format : "Y-m-d",
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 
@@ -139,7 +136,6 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         columnWidth : 0.25
     }, {
         xtype : "detailGridField", 
-        detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
         deleteDetailUrl:'/api/document/vendor/deleteContact/',
         columns : [

+ 0 - 20
frontend/saas-web/app/view/main/Main.scss

@@ -127,26 +127,6 @@ $treelist-nav-ui: (
     color:#fff !important;
 }
 
-.x-grid-necessary .x-column-header-text:before{
-    content: '*';
-    font-size: 130%;
-    color: #ff0000;
-    width: 5px;
-    height: 5px;
-    margin-top: 4px;
-    margin-left: -10px;
-    position: absolute;
-}
-.x-grid-necessary{
-    text-align: center !important;
-    border-width: 1px;
-}
-.x-grid-necessary .x-column-header-text {
-    font: "microsoft yahei";
-    text-align: center;
-    font-size:14px;
-    font-weight: 500;
-}
 .x-query-menu {
     width:68px !important;
 }

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

@@ -27,7 +27,6 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         name: 'id',
         fieldLabel: 'id'
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "ft_date", 
         fieldLabel : "单据日期"
@@ -173,7 +172,6 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "ft_recorddate", 
         fieldLabel : "录入日期",

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

@@ -8,7 +8,6 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
     viewName: 'money-fundtransfer-querypanel',
     
     queryFormItems: [{
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "ft_date", 
         fieldLabel : "单据日期"

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

@@ -149,7 +149,6 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "or_date", 
         fieldLabel : "录入日期",

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

@@ -149,7 +149,6 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "os_date", 
         fieldLabel : "录入日期",

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

@@ -41,7 +41,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         fieldLabel: '单据类型',
         defaultValue: '付款单'
     }, {
-        format: 'Y-m-d h:i:s',
         xtype: "datefield",
         name: "pb_date",
         fieldLabel: "日期"
@@ -173,12 +172,10 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         name: 'pb_recorder',
         fieldLabel: '创建人'
     }, {
-        format: "Y-m-d h:i:s",
         xtype: "datefield",
         name: "pb_recorddate",
         fieldLabel: "创建时间"
     }, {
-        format: 'Y-m-d h:i:s',
         xtype: "datefield",
         name: "updatedate",
         fieldLabel: "更新时间"

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

@@ -225,7 +225,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         name: 'updatedate',
         fieldLabel: '更新时间'
     }, {
-        format: "Y-m-d h:i:s",
         xtype: "datefield",
         name: "rb_recorddate",
         fieldLabel: "创建时间"

+ 18 - 10
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -36,7 +36,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
          xtype: 'button',
          text: '转采购验收单',
          bind: {
-            hidden: '{!id}'
+            hidden: '{turnHidden}'
         },
          handler: 'turnIn'
      }],
@@ -91,11 +91,18 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         storeModel:'saas.model.purchase.Purchasedetail',
         detnoColumn:  'pd_detno',
         deleteDetailUrl:'/api/purchase/purchase/deleteDetail/',
+        allowEmpty: false,
         columns : [
             {
                 text : "id", 
                 dataIndex : "id", 
-                xtype : "numbercolumn"
+                xtype : "numbercolumn",
+                hidden:true
+            },{
+                text : "物料id", 
+                dataIndex : "pd_prodid", 
+                xtype : "numbercolumn",
+                hidden:true
             },
             {
                 text : "物料编号", 
@@ -142,8 +149,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                format:'0',
-                items : null,
+                format:'0,000.00',
                 summaryType: 'sum'
             },
             {
@@ -152,7 +158,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 editor : {
                     xtype : "numberfield"
                 },
-                width : 120.0, 
+                width : 120.0,
+                format:'0,000.00', 
                 xtype : "numbercolumn", 
                 format:'0',
                 items : null,
@@ -174,6 +181,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     xtype : "numberfield"
                 },
                 dataIndex : "pd_taxrate", 
+                format:'0,000.00',
                 width : 120.0, 
                 xtype : "numbercolumn",
             },
@@ -181,23 +189,24 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 text : "含税金额", 
                 dataIndex : "pd_total", 
                 width : 120.0, 
-                xtype : "numbercolumn"
+                format:'0,000.00',
+                xtype : "numbercolumn",
+                summaryType: 'sum'
             }, 
             {
                 text : "未含税金额", 
                 dataIndex : "pd_taxtotal", 
-                width : 120.0, 
+                width : 120.0,
+                format:'0,000.00', 
                 xtype : "numbercolumn"
             },{
                 text : "需求日期", 
                 dataIndex : "pd_delivery", 
                 xtype:'datecolumn',
                 width : 120.0, 
-                format : "Y-m-d H:i:s", 
                 editor : {
                     xtype : "datefield",
                     editable : true, 
-                    format : "Y-m-d H:i:s", 
                     hideTrigger : false
                 }
             },
@@ -208,7 +217,6 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
             }
         ]
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -2,4 +2,13 @@ Ext.define('saas.view.purchase.purchase.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.purchase-purchase-formpanel',
 
+
+    formulas:{
+        turnHidden:{
+            bind:'{pu_statuscode}',
+            get:function(value){
+                return value!='AUDITED';
+            }
+        }
+    }
 });

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

@@ -101,7 +101,8 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             text: 'id',
             dataIndex: 'pu_id',
             width: 100,
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            hidden:true
         }, {
             text: '单据编号',
             dataIndex: 'pu_code',
@@ -180,8 +181,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             text: '已转数',
             dataIndex: 'pd_ytqy',
             xtype: 'numbercolumn',
-            width: 120,
-            flex: 1
+            width: 120
         }]
     }
 });

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

@@ -280,11 +280,10 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
-                flex:1
+                width : 120.0
             }
         ]
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -32,6 +32,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"ve_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],                        
                         dbColumns:[{
                             conditionCode:'ve_id',
                             "text": "供应商ID",

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

@@ -246,7 +246,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             }
         ]
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -31,6 +31,15 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"ve_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'ve_id',
                             "text": "供应商ID",

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

@@ -99,7 +99,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
 				}
             }, {
                 text : "规格", 
@@ -107,7 +107,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
 				}
             }, {
                 text : "数量", 
@@ -153,7 +153,8 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "含税金额", 
                 dataIndex : "sd_total", 
                 width : 120.0, 
-                xtype : "numbercolumn"
+                xtype : "numbercolumn",
+                summaryType: 'sum'
             }, 
             {
                 text : "未税金额", 
@@ -163,11 +164,9 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "交货日期", 
                 dataIndex : "sd_delivery", 
                 xtype:'datecolumn',
-                format : "Y-m-d", 
                 editor : {
                     xtype : "datefield",
                     editable : true, 
-                    format : "Y-m-d", 
                     hideTrigger : false
                 }
             },{
@@ -185,7 +184,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 editor : {
                     xtype : ""
                 },
-                flex : 1.0,
             }
         ]
     }, {
@@ -209,7 +207,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "sa_recorddate", 
         fieldLabel : "录入日期",
@@ -220,7 +217,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         fieldLabel : "审核人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "sa_auditdate", 
         fieldLabel : "审核日期",

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

@@ -192,6 +192,35 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
             }
         });
 
+    },
+    delete: function(){
+        var me = this;
+        var form = this.getView();
+        warnMsg('确定删除该单据吗?', function(btn){
+			if(btn == 'yes'){
+                var viewModel = me.getViewModel();
+                var id = viewModel.get(form._idField);
+                var code = viewModel.get(form._codeField);
+                if(id&&id.value!=0){
+                    me.BaseUtil.request({
+                        url: form._deleteUrl+id,
+                        method: 'POST',
+                    })
+                    .then(function(localJson) {
+                        if(localJson.success){
+                            var mainTab = Ext.getCmp('main-tab-panel');
+                            mainTab.getActiveTab().close();
+                            //解析参数
+                            showToast('删除成功');
+                        }
+                    })
+                    .catch(function(res) {
+                        console.error(res);
+                        showToast('删除失败: ' + res.message);
+                    });
+                }
+                }
+});
     },
     turnOut: function() {
         var me = this,

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

@@ -124,12 +124,11 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '收货地址',
             dataIndex: 'sa_toplace',
-            width: 200
+            width: 380
         }, {
             text: '备注',
             dataIndex: 'sa_remark',
-            width: 250,
-            flex:1
+            width: 250
         }
     ],
         relativeColumn: [ {
@@ -191,8 +190,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '备注',
             dataIndex: 'sd_remark',
-            width: 250,
-            flex: 1
+            width: 250
         }]
     }
 });

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

@@ -94,7 +94,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
 				}
             }, {
                 text : "规格", 
@@ -102,7 +102,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                 }
             }, {
                 text : "数量", 
@@ -200,7 +200,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "pi_recorddate", 
         fieldLabel : "录入日期",
@@ -211,7 +210,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         fieldLabel : "审核人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "pi_auditdate", 
         fieldLabel : "审核日期",

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

@@ -104,7 +104,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
 				}
             }, {
                 text : "规格", 
@@ -112,7 +112,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 ignore:true,
                 width : 150.0, 
                 renderer: function (v, m, r) {
-				    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+				    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
 				}
             },  {
                 text : "出货数量", 
@@ -196,7 +196,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 text : "销售序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
-                flex:1
+                width : 120.0
             }
         ]
     }, {
@@ -210,7 +210,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         fieldLabel : "录入人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "pi_recorddate", 
         
@@ -222,7 +221,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         fieldLabel : "审核人", 
         readOnly:true
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "pi_auditdate", 
         fieldLabel : "审核日期",

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

@@ -261,7 +261,6 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         //     }
         ]
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -31,6 +31,15 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"ve_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'id',
                             "text": "供应商ID",
@@ -71,7 +80,8 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
             'dbfindtrigger[name=pi_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-
+                        addXtype: 'document-customer-formpanel',
+                        addTitle: '客户资料',
                         dataUrl:'/api/document/customer/list',
                         // dataUrl:'http://localhost:9480/customer/list',
                         dbfinds:[{
@@ -86,6 +96,15 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                         },{
                             field:'pi_custname',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"cu_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "cu_name", 
+                            fieldLabel : "客户名称", 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'id',
                             "text": "客户ID",

+ 0 - 3
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -200,11 +200,9 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 dataIndex : "pd_delivery", 
                 flex : 1.0, 
                 xtype:'datecolumn',
-                format : "Y-m-d H:i:s", 
                 editor : {
                     xtype : "datefield",
                     editable : true, 
-                    format : "Y-m-d H:i:s", 
                     hideTrigger : false
                 }
             },
@@ -216,7 +214,6 @@ Ext.define('saas.view.stock.make.FormPanel', {
             }
         ]
     },{
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -226,7 +226,6 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
             }
         ]
     }, {
-        format : "Y-m-d", 
         xtype : "datefield", 
         name : "createTime", 
         bind : "{createTime}", 

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

@@ -25,6 +25,15 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"ve_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'id',
                             "text": "供应商ID",
@@ -65,7 +74,8 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
             'dbfindtrigger[name=pi_custname]': {
                 beforerender: function (f) {
                     Ext.apply(f, {
-
+                        addXtype: 'document-customer-formpanel',
+                        addTitle: '客户资料',
                         dataUrl: '/api/document/customer/list',
                         // dataUrl:'http://localhost:9480/customer/list',
                         dbfinds: [{
@@ -85,6 +95,15 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             field: 'pi_custname',
                             width: 100
                         }],
+                        //联想查询条件
+                        dbtplfield:"cu_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "cu_name", 
+                            fieldLabel : "客户名称", 
+                            columnWidth : 0.25
+                        }],
                         dbColumns: [{
                             conditionCode: 'id',
                             "text": "客户ID",

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

@@ -152,7 +152,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
             },
             {
                 text: "数量",
-                dataIndex: "pd_inqty",
+                dataIndex: "pd_outqty",
                 editor: {
                     xtype: "numberfield"
                 },
@@ -223,7 +223,6 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
             }
         ]
     }, {
-        format: "Y-m-d",
         xtype: "datefield",
         name: "createTime",
         bind: "{createTime}",

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

@@ -25,6 +25,15 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"ve_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],                        
                         dbColumns:[{
                             conditionCode:'id',
                             "text": "供应商ID",
@@ -65,11 +74,10 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
             'dbfindtrigger[name=pi_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-
-                        dataUrl:'/api/document/customer/list',
-                        // dataUrl:'http://localhost:9480/customer/list',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
+                        dataUrl:'/api/document/customer/list',
+                        // dataUrl:'http://localhost:9480/customer/list',
                         dbfinds:[{
                             from:'id',to:'pi_custid'
                         },{
@@ -82,6 +90,15 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                         },{
                             field:'pi_custname',width:100
                         }],
+                        //联想查询条件
+                        dbtplfield:"cu_name",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "cu_name", 
+                            fieldLabel : "客户名称", 
+                            columnWidth : 0.25
+                        }],                        
                         dbColumns:[{
                             conditionCode:'id',
                             "text": "客户ID",

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

@@ -241,12 +241,12 @@ Ext.define('saas.view.sys.finish.DataList', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

+ 2 - 2
frontend/saas-web/app/view/sys/maxnumbers/DataList.js

@@ -356,12 +356,12 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

+ 2 - 2
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -207,12 +207,12 @@ Ext.define('saas.view.sys.messagelog.DataList', {
     getConditionValue: function(xtype, value) {
         var conditionValue;
         if(xtype == 'datefield') {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+            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 h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+            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') {

+ 16 - 0
frontend/saas-web/overrides/form/field/Date.js

@@ -0,0 +1,16 @@
+Ext.define('saas.override.form.field.Date', {
+    override: 'Ext.form.field.Date',
+    formatText: '',
+
+    setValue: function (v) {
+        var me = this;
+
+        if(v && me.format) {
+            v = new Date(v);
+            v = Ext.Date.format(v, me.format);
+        }
+
+        me.callParent(arguments);
+    },
+
+});

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

@@ -58,4 +58,14 @@ function getCurrentTab() {
     var currentTab = mainTab.getActiveTab();
 
     return currentTab;
+}
+
+function warnMsg(msg, fn){
+	Ext.MessageBox.show({
+     	title: '提示',
+     	msg: msg,
+     	buttons: Ext.Msg.YESNO,
+     	icon: Ext.Msg.WARNING,
+     	fn: fn
+	});
 }