Browse Source

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

yingp 7 years ago
parent
commit
1fd9388af5
46 changed files with 1155 additions and 1024 deletions
  1. 2 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 1 1
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  3. 2 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  4. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  5. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  6. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  7. 2 2
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  8. 10 0
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  9. 4 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutMapper.java
  10. 16 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  11. 6 0
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml
  12. 1 1
      framework/core/src/main/java/com/usoftchina/saas/context/SpringContextHolder.java
  13. 8 4
      frontend/saas-web/app/model/purchase/ProdInDetail.js
  14. 8 4
      frontend/saas-web/app/model/purchase/ProdOutDetail.js
  15. 8 4
      frontend/saas-web/app/model/purchase/purchasedetail.js
  16. 9 5
      frontend/saas-web/app/model/sale/SaleInDetail.js
  17. 9 5
      frontend/saas-web/app/model/sale/SaleOutDetail.js
  18. 8 4
      frontend/saas-web/app/model/sale/Saledetail.js
  19. 64 0
      frontend/saas-web/app/model/stock/AppropriationInOut.js
  20. 58 0
      frontend/saas-web/app/model/stock/OtherIn.js
  21. 58 0
      frontend/saas-web/app/model/stock/OtherOut.js
  22. 1 1
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  23. 2 0
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  24. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.scss
  25. 3 0
      frontend/saas-web/app/view/core/report/ReportPanel.scss
  26. 6 15
      frontend/saas-web/app/view/document/product/BasePanel.js
  27. 2 1
      frontend/saas-web/app/view/document/product/FormPanel.js
  28. 0 1
      frontend/saas-web/app/view/home/infoCardList/InfoList.scss
  29. 2 2
      frontend/saas-web/app/view/main/Main.js
  30. 17 10
      frontend/saas-web/app/view/main/MainController.js
  31. 38 21
      frontend/saas-web/app/view/main/Navigation.scss
  32. 22 53
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  33. 62 32
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  34. 16 45
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  35. 15 44
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  36. 21 50
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  37. 65 48
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  38. 15 44
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  39. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  40. 16 45
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  41. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  42. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  43. 1 0
      frontend/saas-web/app/view/stock/make/FormPanel.js
  44. 308 317
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  45. 258 257
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  46. 2 2
      frontend/saas-web/app/view/sys/account/AddWindow.js

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

@@ -126,6 +126,8 @@ public enum BizExceptionCode implements BaseExceptionCode {
     UNENOUGH_DETAIL_STOCK(76300, "行%s库存不足"),
     UNENOUGH_STOCK(76400, "%s :库存不足"),
     UNPOSTSTOCKPROFIT_EXISTS(76500, "存在当前仓库+物料未审核的盘盈盘亏单"),
+    STORAGE_WAREHOUSE_SAME(76501, "调拨单拨入拨出仓库一致"),
+    STORAGE_WAREHOUSE_SAMES(76502, "调拨单: %s 拨入拨出仓库一致"),
     STOCKPROFIT_NULL(76600, "没有需要生成的盘盈盘亏单")
     ;
     private int code;

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

@@ -95,7 +95,7 @@ msg.turnARBill=\u5f00\u7968\u4f5c\u4e1a
 msg.turnNotify=\u8f6c\u901a\u77e5\u5355\u64cd\u4f5c
 msg.turnStorage=\u8f6c\u5165\u5e93
 msg.turnProdIO=\u8f6c\u51fa\u5e93\u5355\u64cd\u4f5c
-msg.turnProdIOReturn=\u8F6C\u9500\u552E\u9A8C\u9000\u5355
+msg.turnProdIOReturn=\u8f6c\u9500\u552e\u9000\u8d27\u5355
 msg.turnProdIO\!OtherOut=\u8f6c\u5176\u5b83\u51fa\u5e93\u5355\u64cd\u4f5c
 msg.turnProdIO\!OtherPurcOut=\u8f6c\u5176\u5b83\u91c7\u8d2d\u51fa\u5e93\u5355
 msg.turnSendNotify=\u8f6c\u53d1\u8d27\u901a\u77e5\u5355\u64cd\u4f5c

+ 2 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -63,4 +63,6 @@ public class SaleDTO extends CommonBaseDTO{
     private Integer sa_sellerid;
 
     private String sa_currency;
+
+    private Double sa_nettotal;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -62,4 +62,6 @@ public class Sale extends CommonBaseEntity{
     private Integer sa_sellerid;
 
     private String sa_currency;
+
+    private Double sa_nettotal;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -69,6 +69,8 @@ public class SaleList implements Serializable {
 
     private Integer sa_sellerid;
 
+    private Double sa_nettotal;
+
     private Integer sd_id;
 
     private Integer sd_said;

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

@@ -204,7 +204,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //更新明细金额等
         setTotal(prodInOut);
         //日志
-      messageLogService.deleteDetail(docBaseDTO);
+        messageLogService.delete(docBaseDTO);
     }
 
     @Override

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

@@ -9,6 +9,7 @@
         <result column="sa_custname" property="sa_custname" jdbcType="VARCHAR" />
         <result column="sa_toplace" property="sa_toplace" jdbcType="VARCHAR" />
         <result column="sa_total" property="sa_total" jdbcType="DOUBLE" />
+        <result column="sa_nettotal" property="sa_nettotal" jdbcType="DOUBLE" />
         <result column="sa_totalupper" property="sa_totalupper" jdbcType="VARCHAR" />
         <result column="sa_remark" property="sa_remark" jdbcType="VARCHAR" />
         <result column="sa_status" property="sa_status" jdbcType="VARCHAR" />
@@ -84,9 +85,8 @@
         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>
-            sa_statuscode='AUDITED'
             <if test="con != null">
-               and  ${con}
+                ${con}
             </if>
             <if test="companyId != null">
                 and   sale.companyId = #{companyId}

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

@@ -35,6 +35,7 @@
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
     <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
     <result column="sa_currency" property="sa_currency" jdbcType="VARCHAR" />
+    <result column="sa_nettotal" property="sa_nettotal" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
@@ -155,6 +156,9 @@
       <if test="sa_currency != null">
         sa_currency,
       </if>
+      <if test="sa_nettotal != null">
+        sa_nettotal,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
@@ -238,6 +242,9 @@
       <if test="sa_currency != null" >
         #{sa_currency,jdbcType=VARCHAR},
       </if>
+      <if test="sa_nettotal != null" >
+        #{sa_nettotal,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
@@ -330,6 +337,9 @@
       <if test="sa_currency != null" >
         sa_currency = #{sa_currency,jdbcType=VARCHAR},
       </if>
+      <if test="sa_nettotal != null" >
+        sa_nettotal = #{sa_nettotal,jdbcType=DOUBLE},
+      </if>
     </set>
     where sa_id = #{id,jdbcType=INTEGER}
   </update>

+ 4 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutMapper.java

@@ -2,9 +2,11 @@ package com.usoftchina.saas.storage.mapper;
 
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
 import java.util.Map;
 
 public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
@@ -31,4 +33,6 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     void unPost(Map<String, Object> map);
 
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long pi_id);
+
+    String checkWarehouse(List<DocBaseDTO> baseDTOs);
 }

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

@@ -219,6 +219,17 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Long id = null;
         DocBaseDTO baseDTO = new DocBaseDTO();
         if (null != formData) {
+            //检测调拨单拨入、拨出仓库是否一致
+            List<ProdIODetailDTO> items = formData.getItems();
+            int count = 0;
+            for (ProdIODetailDTO item : items) {
+                if (item.getPd_inwhcode().equals(item.getPd_whcode())) {
+                    count++;
+                }
+            }
+            if (count > 0) {
+                throw new BizException(BizExceptionCode.STORAGE_WAREHOUSE_SAME);
+            }
             id = formData.getMain().getId();
             if (StringUtils.isEmpty(id)|| "0".equals(String.valueOf(id))) {
                 baseDTO = saveFormData(formData);
@@ -232,7 +243,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Transactional(propagation = Propagation.REQUIRED)
-    private void singleAudit(ProdInOutDTO prodInOutDTO) {
+    public void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         String pi_inoutno = prodInOutDTO.getPi_inoutno();
         String pi_statuscode = prodInOutDTO.getPi_statuscode();
@@ -263,6 +274,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 baseDTOs.getBaseDTOs().size() == 0) {
             return "没有可审核单据。";
         }
+        String codes = getMapper().checkWarehouse(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(codes)) {
+            throw new BizException(BizExceptionCode.STORAGE_WAREHOUSE_SAMES.getCode(), String.format(BizExceptionCode.STORAGE_WAREHOUSE_SAMES.getMessage(), codes));
+        }
         StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             try {

+ 6 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -418,6 +418,12 @@
     update prodinout set creatorId = #{userId} , creatorName=#{userName},createTime=NOW() where pi_id=#{id}
   </update>
 
+  <select id="checkWarehouse" resultType="string" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO">
+    select GROUP_CONCAT( DISTINCT pi_inoutno) from prodinout left join prodiodetail on pi_id=pd_piid where pd_whcode=pd_inwhcode and pi_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
 
     <select id="post" parameterMap="postParamMap" statementType="CALLABLE">
         CALL SP_COMMITPRODINOUT(?, ?, ?, ?, ?)

+ 1 - 1
framework/core/src/main/java/com/usoftchina/saas/context/SpringContextHolder.java

@@ -42,7 +42,7 @@ public class SpringContextHolder {
      */
     public static String getActiveProfile() {
         Assert.notNull(context, "spring context not ready");
-        return context.getEnvironment().getActiveProfiles()[0];
+        return context.getEnvironment().getActiveProfiles().length > 0 ? context.getEnvironment().getActiveProfiles()[0] : "local-dev";
     }
 
     /**

+ 8 - 4
frontend/saas-web/app/model/purchase/ProdInDetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.ProdInDetail', {
         { name: 'pd_netprice', type: 'float'}, // 单价
         { name: 'pd_orderprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_netprice', 'pd_inqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_orderprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_orderprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_orderprice', 'pd_inqty']
         },

+ 8 - 4
frontend/saas-web/app/model/purchase/ProdOutDetail.js

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.ProdOutDetail', {
         { name: 'pd_netprice', type: 'float' }, // 单价
         { name: 'pd_orderprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_netprice', 'pd_outqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_orderprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_orderprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_orderprice', 'pd_outqty']
         },

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

@@ -15,26 +15,30 @@ Ext.define('saas.model.purchase.Purchasedetail', {
         },
         { name: 'pd_price', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_taxprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_taxprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['pd_taxprice', 'pd_taxrate']
         },
         { name: 'pd_taxtotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_taxprice') * rec.get('pd_qty');
+                var t = rec.get('pd_taxprice') * rec.get('pd_qty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_taxprice', 'pd_qty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_total') - rec.get('pd_taxtotal');
+                var t = rec.get('pd_total') - rec.get('pd_taxtotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_total', 'pd_taxtotal']
         },
         { name: 'pd_total', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_price') * rec.get('pd_qty');
+                var t = rec.get('pd_price') * rec.get('pd_qty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_price', 'pd_qty']
         },

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

@@ -15,26 +15,30 @@ Ext.define('saas.model.sale.SaleInDetail', {
         },
         { name: 'pd_sendprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_netprice', 'pd_inqty']
         },
         { name: 'pd_taxrate', type: 'float' }, // 税率
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },
         { name: 'pd_ordertotal', type: 'float',// 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_sendprice') * rec.get('pd_inqty');
+                var t = rec.get('pd_sendprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_sendprice', 'pd_inqty']
         },
@@ -42,7 +46,7 @@ Ext.define('saas.model.sale.SaleInDetail', {
         { name: 'pd_whcode', type: 'string' }, // 仓库编号
         { name: 'pd_whname', type: 'string' }, // 仓库
         { name: 'pd_sdid', type: 'int' }, // 销售订单明细id
-        { name: 'pd_ordercode', type: 'int' }, // 销售单号
+        { name: 'pd_ordercode', type: 'string' }, // 销售单号
         { name: 'pd_orderdetno', type: 'int' }, // 销售序号
         { name: 'pd_remark', type: 'string' }, // 备注
     ],

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

@@ -10,7 +10,7 @@ Ext.define('saas.model.sale.SaleOutDetail', {
         { name: 'pr_detail', type: 'string' }, // 名称
         { name: 'pr_orispeccode', type: 'string' }, // 型号
         { name: 'pr_spec', type: 'string' }, // 规格
-        { name: 'pd_outqty', type: 'int' }, // 出货数量
+        { name: 'pd_outqty', type: 'float' }, // 出货数量
         { name: 'pr_unit', type: 'string' }, // 单位
         { name: 'pd_whid', type: 'int' }, // 仓库id
         { name: 'pd_whcode', type: 'float' }, // 仓库编号
@@ -19,25 +19,29 @@ Ext.define('saas.model.sale.SaleOutDetail', {
         { name: 'pd_netprice', type: 'float' }, // 单价
         { name: 'pd_sendprice', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['pd_netprice', 'pd_taxrate']
         },
         { name: 'pd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('pd_netprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_netprice', 'pd_outqty']
         },
         { name: 'pd_ordertotal', type: 'float', // 价税合计
             convert: function(v, rec) {
-                return rec.get('pd_sendprice') * rec.get('pd_outqty');
+                var t = rec.get('pd_sendprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_sendprice', 'pd_outqty']
         },
         { name: 'pd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         },

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

@@ -15,26 +15,30 @@ Ext.define('saas.model.sale.Saledetail', {
         },
         { name: 'sd_price', type: 'float', // 含税单价
             convert: function(v, rec) {
-                return rec.get('sd_netprice') * (1 + rec.get('sd_taxrate') / 100);
+                var t = rec.get('sd_netprice') * (1 + rec.get('sd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
             },
             depends: ['sd_netprice', 'sd_taxrate']
         },
         { name: 'sd_nettotal', type: 'float', // 金额
             convert: function(v, rec) {
-                return rec.get('sd_netprice') * rec.get('sd_qty');
+                var t = rec.get('sd_netprice') * rec.get('sd_qty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['sd_netprice', 'sd_qty']
         },
         { name: 'sd_taxrate', type: 'float' }, // 税率
         { name: 'sd_taxamount', type: 'float', // 税额
             convert: function(v, rec) {
-                return rec.get('sd_total') - rec.get('sd_nettotal');
+                var t = rec.get('sd_total') - rec.get('sd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['sd_total', 'sd_nettotal']
         },
         { name: 'sd_total', type: 'float',// 价税合计
             convert: function(v, rec) {
-                return rec.get('sd_price') * rec.get('sd_qty');
+                var t = rec.get('sd_price') * rec.get('sd_qty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['sd_price', 'sd_qty']
         },

+ 64 - 0
frontend/saas-web/app/model/stock/AppropriationInOut.js

@@ -0,0 +1,64 @@
+Ext.define('saas.model.stock.AppropriationInOut', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_outqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_orderprice', type: 'float', // 含税单价
+            // convert: function(v, rec) {
+            //     var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+            //     return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
+            // },
+            // depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            // convert: function(v, rec) {
+            //     var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+            //     return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            // },
+            // depends: ['pd_netprice', 'pd_outqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            // convert: function(v, rec) {
+            //     var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+            //     return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            // },
+            // depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            // convert: function(v, rec) {
+            //     var t = rec.get('pd_orderprice') * rec.get('pd_outqty');
+            //     return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            // },
+            // depends: ['pd_orderprice', 'pd_outqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 拨出仓库id
+        { name: 'pd_whcode', type: 'string' }, // 拨出仓库编号
+        { name: 'pd_whname', type: 'string' }, // 拨出仓库
+        { name: 'pd_inwhid', type: 'int' }, // 拨入仓库id
+        { name: 'pd_inwhcode', type: 'string' }, // 拨入仓库编号
+        { name: 'pd_inwhname', type: 'string' }, // 拨入仓库
+        { name: 'pd_ioid', type: 'int' }, // 验收明细id
+        { name: 'iocode', type: 'string' }, // 验收单号
+        { name: 'iodetno', type: 'int' }, // 验收序号
+        { name: 'pd_remark', type: 'string' }, // 备注
+
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
+});

+ 58 - 0
frontend/saas-web/app/model/stock/OtherIn.js

@@ -0,0 +1,58 @@
+Ext.define('saas.model.stock.OtherIn', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_inqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_orderprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                var t = rec.get('pd_netprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_netprice', 'pd_inqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                var t = rec.get('pd_orderprice') * rec.get('pd_inqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_orderprice', 'pd_inqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'string' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_remark', type: 'string' }, // 备注
+
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
+});

+ 58 - 0
frontend/saas-web/app/model/stock/OtherOut.js

@@ -0,0 +1,58 @@
+Ext.define('saas.model.stock.OtherOut', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_outqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_orderprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+                return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                var t = rec.get('pd_netprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_netprice', 'pd_outqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                var t = rec.get('pd_orderprice') * rec.get('pd_outqty');
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_orderprice', 'pd_outqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'string' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_remark', type: 'string' }, // 备注
+
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
+});

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

@@ -122,7 +122,7 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
         rows = rows ? rows : allRows,
         showMore = rows == allRows;
 
-        var n_height = 14 + rows * ( 32 + 10 );
+        var n_height = 14 + rows * ( 32 + 10 - 1 );
 
         unanimate ? me.setHeight(n_height) : me.animate({dynamic: true, duration: 500, to: {height: n_height + 'px'}});
         me.setToggleBtn(showMore);

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

@@ -135,8 +135,10 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
 
                         if(mode=="MAIN"){
                             me.reconfigure(store, me.initColumns(me.baseColumn));
+                            me.applyScrollable(true)
                         }else{
                             me.reconfigure(store, me.initColumns(me.relativeColumn));
+                            me.applyScrollable(true)
                         }
                     }
                 }

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.scss

@@ -3,7 +3,7 @@
     .x-querygrid-code-column {
 
         .x-grid-cell-inner {
-            color: #53b0f3;
+            color: #3e80f6;
             cursor: pointer;
         }
     }

+ 3 - 0
frontend/saas-web/app/view/core/report/ReportPanel.scss

@@ -18,6 +18,9 @@ $border-color: #999;
 
                     .x-column-header-text-inner {
                         font-weight: bold;
+                        &:after {
+                            display: none;
+                        }
                     }
                 }
             }

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

@@ -110,15 +110,12 @@ Ext.define('saas.view.document.product.BasePanel', {
                 return Ext.util.Format.number(v, format);
             }
         }, {
-            text : "标准价(元)", 
+            text : "标准价(元)", 
             dataIndex : "pr_standardprice",
             xtype: 'numbercolumn',
             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,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             }
         },  {
             text : "最新采购价(元)", 
@@ -126,21 +123,15 @@ Ext.define('saas.view.document.product.BasePanel', {
             xtype: 'numbercolumn',
             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);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             }
         }, {
-            text : "最新价(元)", 
+            text : "最新出货单价(元)", 
             dataIndex : "pr_saleprice",
             xtype: 'numbercolumn',
-            width : 120.0,
+            width : 130.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);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             }
         }, {
             text : "备注", 

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

@@ -155,7 +155,8 @@ Ext.define('saas.view.document.product.FormPanel', {
         xtype : "textfield", 
         name : "pr_whname", 
         fieldLabel : "仓库名称", 
-        allowBlank : true, 
+        allowBlank : true,
+        readOnly: true,
         columnWidth : 0.25
     },{
         xtype : "hidden", 

+ 0 - 1
frontend/saas-web/app/view/home/infoCardList/InfoList.scss

@@ -6,7 +6,6 @@
     .x-code-column {
 
         .x-grid-cell-inner {
-            text-decoration: underline;
             color: #3E80F6;
             cursor: pointer;
         }

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

@@ -67,10 +67,10 @@ Ext.define('saas.view.main.Main', {
                 },
                 {
                     margin:'0 3 0 6',
-                    iconCls:'x-fa fa-share-alt-square',
+                    iconCls:'x-fa fa-share-square',
                     cls:'sa-nav-button',
                     ui: 'header',
-                    tooltip: '企业分享',
+                    tooltip: '邀请同事',
                     handler:'shareCompany'
                 },
                 {

+ 17 - 10
frontend/saas-web/app/view/main/MainController.js

@@ -244,10 +244,10 @@ Ext.define('saas.view.main.MainController', {
         //打开分享窗口
         var win = Ext.create('Ext.window.Window', {  
             cls:'x-window-dbfind', 
-            height: 385,
-            width: 350,
+            height: 415,
+            width: 550,
             modal:true,
-            title: '分享企业',
+            title: '邀请同事',
             bodyPadding: 10,
             constrain: true,
             closable: true,
@@ -257,7 +257,7 @@ Ext.define('saas.view.main.MainController', {
                 xtype:'tabpanel',
                 cls:'x-tab-shareTab',
                 items:[{
-                    title:'二维码分享',
+                    title:'二维码邀请',
                     xtype:'panel',
                     layout: {
                         type: 'vbox',
@@ -267,7 +267,7 @@ Ext.define('saas.view.main.MainController', {
                         width:180,
                         height:180,
                         xtype: 'image',
-                        margin:'35 0 0 0',
+                        margin:'25 0 0 0',
                         padding:'5',
                         style:'border: 1px solid #000;',
                         src:'resources/images/default/basePhoto.png',
@@ -276,17 +276,20 @@ Ext.define('saas.view.main.MainController', {
                         listeners:{
                             afterrender:function(f){
                                 var serverOptions = Ext.manifest.server;
-                                var delay = 15;//天
+                                var delay = 1;//天
                                 var basePath = serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath;
-                                f.setSrc('/api/commons/share/qrcode?basePath='+basePath)
+                                f.setSrc('/api/commons/share/qrcode?basePath='+basePath+'&delay='+delay)
                             }
                         }
                     },{
                         xtype:'displayfield',
                         value:'扫描二维码分享至微信/QQ'
+                    },{
+                        xtype:'displayfield',
+                        value:'(分享后'+'<font style="color:#ff0000;">24小时</font>'+'内有效)'
                     }]
                 },{
-                    title:'链接分享',
+                    title:'链接邀请',
                     xtype:'panel',
                     layout: {
                         type: 'vbox',
@@ -298,8 +301,8 @@ Ext.define('saas.view.main.MainController', {
                         value:'复制以下链接分享给好友'
                     },{
                         xtype:'textfield',
-                        width:200,
-                        value:'https://www.usoftchina.com?admin=false&_noc=0'
+                        width:500,
+                        value:'https://saas.usoftchina.com?admin=false&_noc=0'
                     },{
                         margin:'10 0 0 0',
                         width:110,
@@ -319,6 +322,10 @@ Ext.define('saas.view.main.MainController', {
                             document.body.removeChild(target);
                             saas.util.BaseUtil.showSuccessToast('复制链接成功');
                         }
+                    },{
+                        margin:'10 0 0 0',
+                        xtype:'displayfield',
+                        value:'(分享后'+'<font style="color:#ff0000;">24小时</font>'+'内有效)'
                     }]
                 }]
             }]

+ 38 - 21
frontend/saas-web/app/view/main/Navigation.scss

@@ -1,6 +1,8 @@
+$nav-body-background-color: #484A69;
 $nav-font-size: 16px;
 $nav-font-color: #EEEEF2;
 $nav-font-color-over: #fff;
+$menu-body-background-color: #65678C;
 
 .x-navpanel {
     overflow: visible;
@@ -18,7 +20,7 @@ $nav-font-color-over: #fff;
             overflow: visible;
     
             .x-autocontainer-outerCt {
-                background-color: #484A69;
+                background-color: $nav-body-background-color;
     
                 .x-autocontainer-innerCt {
     
@@ -38,7 +40,6 @@ $nav-font-color-over: #fff;
                             outline: none !important;
                             
                             .x-navitem-body {
-                                background: #505275;
     
                                 .nav-inner-wrap {
                                     position: relative;
@@ -74,22 +75,17 @@ $nav-font-color-over: #fff;
                         }
                         .x-navitem-over {
                             .x-navitem-body {
-                                background: #474968;
-                                box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.50);
+                                background: #65678C;
 
                                 .nav-inner-wrap {
 
-                                    &:after {
+                                    &:before {
                                         content: ' ';
-                                        width: 0;
-                                        height: 0;
-                                        border: 8px solid transparent;
-                                        border-right-color: #595B7E;
-                                        border-left: none;
                                         position: absolute;
-                                        right: 0;
-                                        top: 22px;
-                                        z-index: 999999;
+                                        width: 8px;
+                                        height: 60px;
+                                        background: #34baf6;
+                                        left: 0;
                                     }
 
                                     .nav-inner-icon {
@@ -118,6 +114,7 @@ $nav-font-color-over: #fff;
     position: absolute;
     z-index: 9999;
     top: 0;
+    border-left: 1px solid $nav-body-background-color;
     background: white;
     overflow: hidden;
 
@@ -133,23 +130,34 @@ $nav-font-color-over: #fff;
             flex-direction: column;
 
             &:nth-child(2) {
-                .menu-content {
+                .menu-title {
                     border-left: 1px solid #A4ABBC;
                     &:before {
                         content: '';
                         position: absolute;
                         width: 2px;
                         height: 22px;
-                        margin-left: -2px;
-                        background: #484A69;
+                        margin-left: -31px;
+                        background: $menu-body-background-color;
                     }
+                }
+                .menu-content {
+                    border-left: 1px solid #A4ABBC;
+                    // &:before {
+                    //     content: '';
+                    //     position: absolute;
+                    //     width: 2px;
+                    //     height: 22px;
+                    //     margin-left: -2px;
+                    //     background: $menu-body-background-color;
+                    // }
                     &:after {
                         content: '';
                         position: absolute;
                         width: 2px;
                         height: 22px;
                         margin-left: -2px;
-                        background: #484A69;
+                        background: $menu-body-background-color;
                         bottom: 0;
                     }
                 }
@@ -157,7 +165,7 @@ $nav-font-color-over: #fff;
 
             .menu-title {
                 padding-left: 30px;
-                background: #484A69;
+                background: $menu-body-background-color;
 
                 .menu-title-text {
                     height: 40px;
@@ -172,7 +180,7 @@ $nav-font-color-over: #fff;
 
             .menu-content {
                 height: 100%;
-                background: #484A69;
+                background: $menu-body-background-color;
                 
                 .menuitem {
                     padding-left: 25px;
@@ -198,7 +206,7 @@ $nav-font-color-over: #fff;
                         color: #fff;
                         display: none;
                         padding: 3px 6px;
-                        border-radius: 3px;
+                        // border-radius: 3px;
                         margin-right: 5px;
                         height: 24px;
                         margin-top: 5px;
@@ -209,9 +217,18 @@ $nav-font-color-over: #fff;
                     }
 
                     &:hover {
-                        border-radius: 4px;
+                        // border-radius: 4px;
                         background-color: #595B7E;
 
+                        &:before {
+                            content: ' ';
+                            position: absolute;
+                            width: 6px;
+                            height: 34px;
+                            background: #34baf6;
+                            margin-left: -25px;
+                        }
+
                         .item-icon {
                             display: block;
                         }

+ 22 - 53
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -94,15 +94,13 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     text: "物料编号",
                     width: 150.0,
                     dataIndex: "pd_prodcode",
-                    xtype: "",
-                    items: null,
                     allowBlank: false,
                     editor: {
                         xtype: "productMultiDbfindTrigger"
                     }
                 }, {
                     text: "品牌",
-                    width: 150.0,
+                    width: 100.0,
                     dataIndex: "pr_brand",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -112,8 +110,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         return v;
                     }
                 }, {
-                    text: "名称",
-                    width: 200.0,
+                    text: "物料名称",
+                    width: 150.0,
                     dataIndex: "pr_detail",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -139,7 +137,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     hidden: true,
                 }, {
                     text: "规格",
-                    width: 150,
+                    width: 200,
                     dataIndex: "pr_spec",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -160,21 +158,15 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     }
                 }, {
                     text: "单位",
-                    width: 80.0,
+                    width: 65.0,
                     dataIndex: "pr_unit",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -194,10 +186,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     }
                 }, {
                     text: "含税单价(元)",
@@ -210,38 +199,30 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     },
                     listeners: {
                         edit: function (value, grid) {
                             var r = grid.getSelection()[0],
                                 pd_taxrate = r.get('pd_taxrate');
-                            r.set('pd_taxprice', value / (1 + pd_taxrate / 100));
+                            var v = value / (1 + pd_taxrate / 100);
+                            r.set('pd_taxprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                         }
                     }
                 }, {
-                    text: "金额",
+                    text: "金额(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "pd_taxtotal",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
-                    text: "税率",
+                    text: "税率(%)",
                     xtype: 'numbercolumn',
                     dataIndex: "pd_taxrate",
                     width: 80,
@@ -255,40 +236,28 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: "税额",
+                    text: "税额(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "pd_taxamount",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
-                    text: "价税合计",
+                    text: "价税合计(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "pd_total",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "需求日期",
@@ -304,7 +273,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     text: "最小包装数",
                     xtype: 'numbercolumn',
                     dataIndex: "pr_zxbzs",
-                    width: 110.0,
+                    width: 100.0,
                     ignore: true,
                     renderer: function (v, m, r) {
                         if (!v) {

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

@@ -113,22 +113,43 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '供应商名称',
             dataIndex: 'pu_vendname',
-            width:250
+            width:200
         }, {
-            text: '总金额',
+            text: '金额(元)',
+            dataIndex: 'pu_taxtotal',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '价税合计(元)',
             dataIndex: 'pu_total',
             xtype: 'numbercolumn',
-            width: 110
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '审核状态',
             align: 'center',
             dataIndex: 'pu_status',
-            width: 90
+            width: 80
         },{
             text: '业务状态',
             align: 'center',
             dataIndex: 'pu_acceptstatus',
-            width: 90
+            width: 80
+        },{
+            text: '采购员',
+            dataIndex: 'pu_buyername',
+            width: 80
         },{
             text: '关联销售单',
             dataIndex: 'pu_sacode',
@@ -156,22 +177,17 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '供应商名称',
             dataIndex: 'pu_vendname',
-            width: 150
+            width: 200
         }, {
             text: '审核状态',
             align: 'center',
             dataIndex: 'pu_status',
-            width: 90
-        },{
-            text: '业务状态',
-            align: 'center',
-            dataIndex: 'pu_acceptstatus',
-            width: 90
+            width: 80
         }, {
             text: '序号',
             dataIndex: 'pd_detno',
             xtype: 'numbercolumn',
-            width: 80, 
+            width: 65, 
             renderer : function(v) {
                 return Ext.util.Format.number(v, '0');
             }
@@ -182,11 +198,11 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '品牌',
             dataIndex: 'pr_brand',
-            width: 150
+            width: 100
         },{
-            text: '名称',
+            text: '物料名称',
             dataIndex: 'pr_detail',
-            width: 200
+            width: 150
         },{
             text: '型号',
             dataIndex: 'pr_orispeccode',
@@ -194,7 +210,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '规格',
             dataIndex: 'pr_spec',
-            width: 150
+            width: 200
         },{
             text: '采购数量',
             dataIndex: 'pd_qty',
@@ -209,10 +225,10 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '单位',
             dataIndex: 'pr_unit',
-            width: 80
+            width: 65
         }, {
             text: '单价(元)',
-            dataIndex: 'pd_price',
+            dataIndex: 'pd_taxprice',
             xtype: 'numbercolumn',
             width: 110,
             renderer : function(v) {
@@ -221,21 +237,31 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                 var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
             }
-        }, {
-            text: '需求日期',
-            dataIndex: 'pd_delivery',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '税率',
-            dataIndex: 'pd_taxrate',
+        },{
+            text: '金额(元)',
+            dataIndex: 'pd_taxtotal',
             xtype: 'numbercolumn',
-            width: 80,
+            width: 110,
             renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            },
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        },{
+            text: '税额',
+            dataIndex: 'pd_taxamount',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v,g,r) {
+                v = (r.data["pd_total"]||0.0) - (r.data["pd_taxtotal"]||0.0);
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         },{
-            text: '金额',
+            text: '价税合计(元)',
             dataIndex: 'pd_total',
             xtype: 'numbercolumn',
             width: 110,
@@ -245,7 +271,11 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                 var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
             }
-        },{
+        }, {
+            text: '关联销售单号',
+            dataIndex: 'pd_salecode',
+            width: 150
+        }, {
             text: '备注',
             dataIndex: 'pd_remark',
             width: 250

+ 16 - 45
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -184,17 +184,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -217,12 +211,9 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 minValue: 0
             },
             dataIndex: "pd_netprice",
-            width: 120.0,
+            width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -236,35 +227,27 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             dataIndex: "pd_orderprice",
             width: 120.0,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                 }
             }
         }, {
-            text: "金额",
+            text: "金额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_nettotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             xtype: 'numbercolumn',
@@ -281,40 +264,28 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 return Ext.util.Format.number(v, '0');
             },
         }, {
-            text: "税额",
+            text: "税额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
-            text: "价税合计",
+            text: "价税合计(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库id",

+ 15 - 44
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -179,17 +179,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -213,10 +207,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -229,35 +220,27 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
             },
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                 }
             }
         }, {
-            text: "金额",
+            text: "金额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_nettotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "税率",
@@ -274,40 +257,28 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 return Ext.util.Format.number(v, '0');
             },
         }, {
-            text: "税额",
+            text: "税额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
-            text: "价税合计",
+            text: "价税合计(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库id",

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

@@ -129,7 +129,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     hidden: true,
                 }, {
                     text: "品牌",
-                    width: 150.0,
+                    width: 100.0,
                     dataIndex: "pr_brand",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -139,8 +139,8 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         return v;
                     }
                 }, {
-                    text: "名称",
-                    width: 200.0,
+                    text: "物料名称",
+                    width: 150.0,
                     dataIndex: "pr_detail",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -162,7 +162,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     }
                 }, {
                     text: "规格",
-                    width: 150,
+                    width: 200,
                     dataIndex: "pr_spec",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -183,21 +183,15 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                        var format = '0.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 3, true);
                     }
                 }, {
                     text: "单位",
-                    width: 80.0,
+                    width: 65.0,
                     dataIndex: "pr_unit",
                     ignore: true,
                     renderer: function (v, m, r) {
@@ -217,10 +211,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     }
                 }, {
                     text: "含税单价(元)",
@@ -233,38 +224,30 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         minValue: 0
                     },
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
                     },
                     listeners: {
                         edit: function (value, grid) {
                             var r = grid.getSelection()[0],
                                 sd_taxrate = r.get('sd_taxrate');
-                            r.set('sd_netprice', value / (1 + sd_taxrate / 100));
+                            var v = value / (1 + sd_taxrate / 100);
+                            r.set('sd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                         }
                     }
                 }, {
-                    text: "金额",
+                    text: "金额(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "sd_nettotal",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
-                    text: "税率",
+                    text: "税率(%)",
                     xtype: 'numbercolumn',
                     dataIndex: "sd_taxrate",
                     width: 80,
@@ -278,40 +261,28 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: "税额",
+                    text: "税额(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "sd_taxamount",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
-                    text: "价税合计",
+                    text: "价税合计(元)",
                     xtype: 'numbercolumn',
                     dataIndex: "sd_total",
                     width: 120,
                     renderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
                     summaryType: 'sum',
                     summaryRenderer: function (v) {
-                        var arr = (v + '.').split('.');
-                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                        var format = '0,000.' + xr.join('');
-                        return Ext.util.Format.number(v, format);
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
                     text: "交货日期",

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

@@ -108,16 +108,23 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 110
-        }, {
-            text: '客户编号',
-            dataIndex: 'sa_custcode',
-            hidden :true
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
-            width: 250
+            width: 200
         }, {
-            text: '总金额',
+            text: '金额(元)',
+            dataIndex: 'sa_nettotal',
+            width: 110,
+            xtype: 'numbercolumn',
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '价税合计(元)',
             dataIndex: 'sa_total',
             width: 110,
             xtype: 'numbercolumn',
@@ -131,20 +138,16 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             text: '审核状态',
             align: 'center',
             dataIndex: 'sa_status',
-            width: 90
+            width: 80
         }, {
             text: '业务状态',
             align: 'center',
             dataIndex: 'sa_sendstatus',
-            width: 100
+            width: 80
         }, {
             text: '业务员',
             dataIndex: 'sa_seller',
-            width: 110
-        }, {
-            text: '收货地址',
-            dataIndex: 'sa_toplace',
-            hidden :true
+            width: 80
         }, {
             text: '备注',
             dataIndex: 'sa_remark',
@@ -157,48 +160,39 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             hidden:true,
             xtype: 'numbercolumn'
         }, {
-            text: '单据编号',
+            text: '销售单号',
             dataIndex: 'sa_code',
-            width: 200
-        }, {
-            text: '单据状态',
-            align: 'center',
-            dataIndex: 'sa_status',
-            width: 120
+            width: 150
         }, {
             text: '单据日期',
             dataIndex: 'sa_date',
             xtype: 'datecolumn',
-            width: 200
+            width: 110
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
-            width: 120
-        },  {
-            text: '业务状态',
+            width: 200
+        }, {
+            text: '审核状态',
             align: 'center',
-            dataIndex: 'sa_sendstatus',
-            width: 90
+            dataIndex: 'sa_status',
+            width: 80
         }, {
-            text: '明细序号',
-            dataIndex: 'sd_detno',
-            xtype: 'numbercolumn',
-            width: 120,
-            renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            }
+            text: '业务员',
+            dataIndex: 'sa_seller',
+            width: 80
         }, {
             text: '物料编号',
             dataIndex: 'sd_prodcode',
-            width: 120
+            width: 150
         },{
             text: '品牌',
             dataIndex: 'pr_brand',
-            width: 150
+            width: 100
         },{
-            text: '名称',
+            text: '物料名称',
             dataIndex: 'pr_detail',
-            width: 200
+            width: 150
         },{
             text: '型号',
             dataIndex: 'pr_orispeccode',
@@ -206,12 +200,12 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         },{
             text: '规格',
             dataIndex: 'pr_spec',
-            width: 150
+            width: 200
         },{
             text: '数量',
             dataIndex: 'sd_qty',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
@@ -221,12 +215,12 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '单位',
             dataIndex: 'pr_unit',
-            width: 80
+            width: 65
         }, {
             text: '单价(元)',
-            dataIndex: 'sd_price',
+            dataIndex: 'sd_netprice',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -234,16 +228,39 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                 return Ext.util.Format.number(v, format);
             },
         }, {
-            text: '已出货数',
-            dataIndex: 'sd_sendqty',
+            text: '金额(元)',
+            dataIndex: 'sd_nettotal',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 110,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
-            },
+            }
+        }, {
+            text: '税额',
+            dataIndex: 'sd_taxamount',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v,g,r) {
+                v = (r.data["sd_total"]||0.0) - (r.data["sd_nettotal"]||0.0);
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        },{
+            text: '价税合计(元)',
+            dataIndex: 'sd_total',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '备注',
             dataIndex: 'sd_remark',

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

@@ -198,17 +198,11 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 3, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 3, true);
                 }
             },{
                 text : "单位", 
@@ -232,10 +226,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 4, true);
                 },
             }, {
                 text : "含税单价(元)", 
@@ -248,35 +239,27 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     minValue:0
                 },
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 4, true);
                 },
                 listeners: {
                     edit: function(value, grid) {
                         var r = grid.getSelection()[0],
                         pd_taxrate = r.get('pd_taxrate');
-                        r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                        var v = value / (1 + pd_taxrate / 100);
+                        r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                     }
                 }
             }, {
-                text : "金额", 
+                text : "金额(元)", 
                 xtype: 'numbercolumn',
                 dataIndex : "pd_nettotal", 
                 width : 120, 
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
                 text : "税率", 
@@ -293,40 +276,28 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     return Ext.util.Format.number(v, '0');
                 },
             }, {
-                text: "税额",
+                text: "税额(元)",
                 xtype: 'numbercolumn',
                 dataIndex: "pd_taxamount",
                 width: 120,
                 renderer: function (v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function (v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
-                text : "价税合计", 
+                text : "价税合计(元)", 
                 xtype: 'numbercolumn',
                 dataIndex : "pd_ordertotal", 
                 width : 120, 
                 renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 }
             }, {
                 text : "仓库ID", 

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

@@ -243,7 +243,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             dataIndex: 'pr_unit',
             width: 80
         }, {
-            text: '销售单价(元)',
+            text: '出货单价(元)',
             dataIndex: 'pd_sendprice',
             xtype:'numbercolumn',
             width: 140,

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

@@ -205,17 +205,11 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                var format = '0.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             }
         }, {
             text: "单位",
@@ -239,10 +233,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
         }, {
             text: "含税单价(元)",
@@ -255,35 +246,27 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 minValue: 0
             },
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
             listeners: {
                 edit: function (value, grid) {
                     var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_netprice');
-                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                        pd_taxrate = r.get('pd_taxrate');
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                 }
             }
         }, {
-            text: "金额",
+            text: "金额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_nettotal",
             width: 120,
             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);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             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);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "税率",
@@ -300,40 +283,28 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 return Ext.util.Format.number(v, '0');
             }
         }, {
-            text: "税额",
+            text: "税额(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_taxamount",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
-            text: "价税合计",
+            text: "价税合计(元)",
             xtype: 'numbercolumn',
             dataIndex: "pd_ordertotal",
             width: 120,
             renderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             },
             summaryType: 'sum',
             summaryRenderer: function (v) {
-                var arr = (v + '.').split('.');
-                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                var format = '0,000.' + xr.join('');
-                return Ext.util.Format.number(v, format);
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
             }
         }, {
             text: "仓库ID",

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

@@ -235,7 +235,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             dataIndex: 'pr_unit',
             width: 80
         }, {
-            text: '销售单价(元)',
+            text: '出货单价(元)',
             dataIndex: 'pd_sendprice',
             xtype:'numbercolumn',
             width: 140,

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

@@ -75,7 +75,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail',
+        storeModel:'saas.model.stock.AppropriationInOut',
         deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
         detnoColumn:  'pd_pdno',
         columns : [

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

@@ -98,6 +98,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
         fieldLabel : "数量",
         columnWidth: 0.25,
         allowBlank : false,
+        decimalPrecision:3,
         vtype: 'positiveNumber',
     },{
         xtype : "hidden", 

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

@@ -6,24 +6,24 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
     viewModel: 'stock-otherin-formpanel',
 
     viewName: 'stock-otherin-formpanel',
-    caller:'OtherIn',
-    
-     //字段属性
-    
-    _title:'其它入库单',
+    caller: 'OtherIn',
+
+    //字段属性
+
+    _title: '其它入库单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/storage/prodinout/read',
-    _saveUrl:'/api/storage/prodinout/save',
-    _auditUrl:'/api/storage/prodinout/audit',
+    _readUrl: '/api/storage/prodinout/read',
+    _saveUrl: '/api/storage/prodinout/save',
+    _auditUrl: '/api/storage/prodinout/audit',
     _unAuditUrl: '/api/storage/prodinout/unAudit',
-    _deleteUrl:'/api/storage/prodinout/delete',
-    initId:0,
+    _deleteUrl: '/api/storage/prodinout/delete',
+    initId: 0,
 
     toolBtns: [],
 
@@ -33,20 +33,20 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    },{
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "pi_custid", 
-        fieldLabel : "客户ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
+    }, {
+        xtype: "hidden",
+        name: "pi_class",
+        fieldLabel: "单据类型",
+        readOnly: true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: "hidden",
+        name: "pi_custid",
+        fieldLabel: "客户ID",
+        allowBlank: true,
+        columnWidth: 0.0
+    }, {
         xtype: 'hidden',
         name: 'pi_custcode',
         fieldLabel: '客户编号'
@@ -54,13 +54,13 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         xtype: 'hidden',
         name: 'pi_custname',
         fieldLabel: '客户名称'
-    },{
-        xtype : "hidden", 
-        name : "pi_vendid", 
-        fieldLabel : "供应商ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
+    }, {
+        xtype: "hidden",
+        name: "pi_vendid",
+        fieldLabel: "供应商ID",
+        allowBlank: true,
+        columnWidth: 0.0
+    }, {
         xtype: 'hidden',
         name: 'pi_vendcode',
         fieldLabel: '供应商编号'
@@ -68,309 +68,300 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         xtype: 'vendorDbfindTrigger',
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
-        allowBlank : true,
-    },{
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
+        allowBlank: true,
+    }, {
+        xtype: "datefield",
+        name: "pi_date",
+        fieldLabel: "单据日期",
+        allowBlank: false,
+        columnWidth: 0.25,
         defaultValue: new Date()
-    },{
-        xtype : "textfield", 
-        name : "pi_total", 
-        fieldLabel : "总额", 
-        allowBlank : true,
+    }, {
+        xtype: "textfield",
+        name: "pi_total",
+        fieldLabel: "总额",
+        allowBlank: true,
         readOnly: true,
-        columnWidth : 0.25
+        columnWidth: 0.25
     }, {
-        name : "detailGridField", 
-        xtype : "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail',
-        deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
-        detnoColumn:  'pd_pdno',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            },{
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 150.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 150, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+        name: "detailGridField",
+        xtype: "detailGridField",
+        storeModel: 'saas.model.stock.OtherIn',
+        deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
+        detnoColumn: 'pd_pdno',
+        columns: [{
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料id",
+            dataIndex: "pd_prodid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料编号",
+            width: 150.0,
+            dataIndex: "pd_prodcode",
+            xtype: "",
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "productMultiDbfindTrigger"
+            }
+        }, {
+            text: 'model映射需要',
+            dataIndex: 'productDTO',
+            hidden: true,
+        }, {
+            text: "品牌",
+            width: 150.0,
+            dataIndex: "pr_brand",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_inqty", 
-                width : 110.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + 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 > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "名称",
+            width: 200.0,
+            dataIndex: "pr_detail",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "型号",
+            width: 200.0,
+            dataIndex: "pr_orispeccode",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单价(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_orderprice",
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "规格",
+            width: 150,
+            dataIndex: "pr_spec",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "仓库id", 
-                dataIndex : "pd_whid", 
-                xtype : "numbercolumn",
-                hidden:true
+                return v;
+            }
+        }, {
+            text: "数量",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_inqty",
+            width: 110.0,
+            allowBlank: false,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 3,
+                minValue: 0
             },
-            {
-                text : "仓库编号", 
-                dataIndex : "pd_whcode",
-                hidden:true
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
-            {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                width : 150.0, 
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
-                }
-            }, {
-                text : "税率", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_taxrate", 
-                width : 80.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                },
-                renderer : function(v) {
-                    return Ext.util.Format.number(v, '0');
-                }
-            }, 
-           {
-                text : "含税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 150.0,
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable:false
-                // },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : 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 > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
+            }
+        }, {
+            text: "单位",
+            width: 80.0,
+            dataIndex: "pr_unit",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
+                return v;
+            }
+        }, {
+            text: "单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_netprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                text : "未税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 150.0, 
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable:false
-                // },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : 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 > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
+            }
+        }, {
+            text: "含税单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_orderprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
+            },
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
+            },
+            listeners: {
+                edit: function (value, grid) {
+                    var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_taxrate');
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                 }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
             }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
-    },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
+        }, {
+            text: "金额(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_nettotal",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "税率",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxrate",
+            width: 80,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 0,
+                minValue: 0,
+                maxValue: 100
+            },
+            renderer: function (v) {
+                return Ext.util.Format.number(v, '0');
+            }
+        }, {
+            text: "税额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxamount",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "价税合计",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_ordertotal",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "仓库id",
+            dataIndex: "pd_whid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "仓库编号",
+            dataIndex: "pd_whcode",
+            hidden: true
+        }, {
+            text: "仓库",
+            dataIndex: "pd_whname",
+            width: 150.0,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "warehouseDbfindTrigger"
+            }
+        }, {
+            text: "备注",
+            dataIndex: "pd_remark",
+            width: 250,
+            items: null,
+            editor: {
+                xtype: "textfield"
+            },
+        }]
+    }, {
+        xtype: "textfield",
+        name: "pi_remark",
+        fieldLabel: "备注",
+        columnWidth: 1
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "creatorId",
+        fieldLabel: "录入人ID",
+        readOnly: true
+    }, {
+        xtype: "textfield",
+        name: "creatorName",
+        fieldLabel: "录入人",
+        readOnly: true
+    }, {
+        xtype: "datefield",
+        name: "createTime",
+        fieldLabel: "录入日期",
+        readOnly: true,
         defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
     }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "updaterId",
+        fieldLabel: "更新人ID",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updaterName",
+        fieldLabel: "更新人",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updateTime",
+        fieldLabel: "更新日期",
+        readOnly: true,
         defaultValue: new Date()
     }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "pi_auditman",
+        fieldLabel: "审核人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
+        xtype: "datefield",
+        name: "pi_auditdate",
+        fieldLabel: "审核日期",
+        readOnly: true
     }]
 });

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

@@ -15,7 +15,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl: '/api/storage/prodinout/read',
     _saveUrl: '/api/storage/prodinout/save',
@@ -52,7 +52,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     }, {
         xtype: 'customerDbfindTrigger',
         name: 'pi_custname',
-        allowBlank : true,
+        allowBlank: true,
         fieldLabel: '客户名称'
     }, {
         xtype: "datefield",
@@ -71,281 +71,282 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     }, {
         name: "detailGridField",
         xtype: "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail',
+        storeModel: 'saas.model.stock.OtherOut',
         deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
         detnoColumn: 'pd_pdno',
         columns: [{
-                text: "id",
-                dataIndex: "id",
-                xtype: "numbercolumn",
-                hidden: true
-            }, {
-                text: "物料id",
-                dataIndex: "pd_prodid",
-                xtype: "numbercolumn",
-                hidden: true
-            },
-            {
-                text: "物料编号",
-                width: 150.0,
-                dataIndex: "pd_prodcode",
-                xtype: "",
-                items: null,
-                allowBlank : false,
-                editor: {
-                    displayField: "display",
-                    editable: true,
-                    format: "",
-                    hideTrigger: false,
-                    maxLength: 100.0,
-                    minValue: null,
-                    positiveNum: false,
-                    queryMode: "local",
-                    store: null,
-                    valueField: "value",
-                    xtype: "productMultiDbfindTrigger"
-                }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 150.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 150, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料id",
+            dataIndex: "pd_prodid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料编号",
+            width: 150.0,
+            dataIndex: "pd_prodcode",
+            xtype: "",
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "productMultiDbfindTrigger"
+            }
+        }, {
+            text: 'model映射需要',
+            dataIndex: 'productDTO',
+            hidden: true,
+        }, {
+            text: "品牌",
+            width: 150.0,
+            dataIndex: "pr_brand",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text: "数量",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_outqty",
-                allowBlank : false,
-                width: 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + 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 > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "名称",
+            width: 200.0,
+            dataIndex: "pr_detail",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "型号",
+            width: 200.0,
+            dataIndex: "pr_orispeccode",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text: "单价(元)",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_orderprice", 
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "规格",
+            width: 150,
+            dataIndex: "pr_spec",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text: "仓库id",
-                dataIndex: "pd_whid",
-                xtype: "numbercolumn",
-                hidden: true
+                return v;
+            }
+        }, {
+            text: "数量",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_outqty",
+            allowBlank: false,
+            width: 110.0,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 3,
+                minValue: 0
             },
-            {
-                text: "仓库编号",
-                dataIndex: "pd_whcode",
-                hidden: true
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
             },
-            {
-                text: "仓库",
-                dataIndex: "pd_whname",
-                width: 150.0,
-                allowBlank : false,
-                editor: {
-                    displayField: "display",
-                    editable: true,
-                    format: "",
-                    hideTrigger: false,
-                    maxLength: 100.0,
-                    minValue: null,
-                    positiveNum: false,
-                    queryMode: "local",
-                    store: null,
-                    valueField: "value",
-                    xtype: "warehouseDbfindTrigger"
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 3, true);
+            }
+        }, {
+            text: "单位",
+            width: 80.0,
+            dataIndex: "pr_unit",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
+                return v;
+            }
+        }, {
+            text: "单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_netprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                text: "税率",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_taxrate", 
-                width : 80.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                },
-                renderer : function(v) {
-                    return Ext.util.Format.number(v, '0');
-                }
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
+            }
+        }, {
+            text: "含税单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_orderprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                text: "含税金额",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_ordertotal",
-                width: 150.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,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 > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                }
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 4, true);
             },
-            {
-                text: "未税金额",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_nettotal", 
-                width : 150.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,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 > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            listeners: {
+                edit: function (value, grid) {
+                    var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_taxrate');
+                    var v = value / (1 + pd_taxrate / 100);
+                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
                 }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
             }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
-    },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
+        }, {
+            text: "金额(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_nettotal",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "税率",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxrate",
+            width: 80,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 0,
+                minValue: 0,
+                maxValue: 100
+            },
+            renderer: function (v) {
+                return Ext.util.Format.number(v, '0');
+            }
+        }, {
+            text: "税额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxamount",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "价税合计",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_ordertotal",
+            width: 120,
+            renderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            }
+        }, {
+            text: "仓库id",
+            dataIndex: "pd_whid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "仓库编号",
+            dataIndex: "pd_whcode",
+            hidden: true
+        }, {
+            text: "仓库",
+            dataIndex: "pd_whname",
+            width: 150.0,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "warehouseDbfindTrigger"
+            }
+        }, {
+            text: "备注",
+            dataIndex: "pd_remark",
+            width: 250,
+            items: null,
+            editor: {
+                xtype: "textfield"
+            },
+        }]
+    }, {
+        xtype: "textfield",
+        name: "pi_remark",
+        fieldLabel: "备注",
+        columnWidth: 1
+    }, {
+        xtype: "hidden",
+        name: "creatorId",
+        fieldLabel: "录入人ID",
+        readOnly: true
+    }, {
+        xtype: "textfield",
+        name: "creatorName",
+        fieldLabel: "录入人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
+        xtype: "datefield",
+        name: "createTime",
+        fieldLabel: "录入日期",
+        readOnly: true,
         defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
     }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "updaterId",
+        fieldLabel: "更新人ID",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updaterName",
+        fieldLabel: "更新人",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updateTime",
+        fieldLabel: "更新日期",
+        readOnly: true,
         defaultValue: new Date()
     }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "pi_auditman",
+        fieldLabel: "审核人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
+        xtype: "datefield",
+        name: "pi_auditdate",
+        fieldLabel: "审核日期",
+        readOnly: true
     }]
 });

+ 2 - 2
frontend/saas-web/app/view/sys/account/AddWindow.js

@@ -106,8 +106,8 @@ Ext.define('saas.view.sys.account.AddWindow', {
                 xtype:'textfield',
                 fieldLabel: '真实姓名',
                 name: 'realname',
-                regex:/^[\u4e00-\u9fa5]+$/,
-                regexText:'请输入汉字',
+                // regex:/^[\u4e00-\u9fa5]+$/,
+                // regexText:'请输入汉字',
                 allowBlank:false,
                 maxLength: 30,
                 columnWidth:0.5