Browse Source

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

zhuth 7 years ago
parent
commit
261590da7a
27 changed files with 509 additions and 155 deletions
  1. 2 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  2. 38 32
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  3. 1 1
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  4. 5 4
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java
  5. 4 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdIODetailMapper.java
  6. 2 2
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutService.java
  7. 51 35
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  8. 14 0
      applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml
  9. 3 5
      frontend/saas-web/app/view/core/base/GridPanel.js
  10. 1 5
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  11. 0 4
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  12. 5 5
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  13. 41 0
      frontend/saas-web/app/view/document/kind/ChildForm.js
  14. 27 0
      frontend/saas-web/app/view/document/kind/Kind.js
  15. 6 0
      frontend/saas-web/app/view/main/Main.scss
  16. 4 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  17. 8 4
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  18. 0 8
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  19. 1 9
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  20. 212 0
      frontend/saas-web/app/view/sys/finish/DataList.js
  21. 43 14
      frontend/saas-web/app/view/sys/maxnumbers/DataList.js
  22. 10 0
      frontend/saas-web/app/view/sys/maxnumbers/DataListController.js
  23. 4 0
      frontend/saas-web/app/view/sys/maxnumbers/DataListlModel.js
  24. 2 19
      frontend/saas-web/app/view/sys/messagelog/DataList.js
  25. 2 1
      frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/field/Date.js
  26. 20 0
      frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/grid/pagtoolbar/Paging.js
  27. 3 4
      frontend/saas-web/resources/json/navigation.json

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

@@ -47,7 +47,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     DocBaseDTO audit(ProdInOutFormDTO formData);
 
-    void batchAudit(BatchDealBaseDTO baseDTOs);
+    String batchAudit(BatchDealBaseDTO baseDTOs);
 
     /**
      * 反审核出入库单
@@ -55,7 +55,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     void unAudit(Long id);
 
-    void batchUnAudit(BatchDealBaseDTO baseDTOs);
+    String batchUnAudit(BatchDealBaseDTO baseDTOs);
 
     void deleteItem(Long id);
 

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

@@ -232,91 +232,97 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 baseDTO = saveFormData(formData);
                 id = baseDTO.getId();
             }
-            String res = singleAudit(formData.getMain());
-            if(res!=null){
-                new BizException(501,res);
-            }
+            singleAudit(formData.getMain());
         }
         baseDTO.setId(id);
         return baseDTO;
     }
 
-    private String singleAudit(ProdInOutDTO prodInOutDTO) {
+    private void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
-        warehouseApi.post(map);
-        Object result =  map.get("result");
-        if(result!=null){
-            return result.toString();
+        Result res = warehouseApi.post(map);
+        Object result =  res.getData();
+        if(!StringUtils.isEmpty(result)){
+            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
             //日志
             messageLogService.audit(docBaseDTO);
-            return "";
         }
     }
 
     @Override
-    public void batchAudit(BatchDealBaseDTO baseDTOs) {
+    public String batchAudit(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
                 baseDTOs.getBaseDTOs().size() == 0) {
-            return;
+            return "没有可审核单据。";
         }
+        StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
-            Long id =  base.getId();
-            ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
-            singleAudit(prodInOutDTO);
+            try {
+                Long id =  base.getId();
+                ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+                ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+                singleAudit(prodInOutDTO);
+            } catch (Exception e) {
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
         }
+        return errorMsg.toString();
     }
 
     @Override
     public void unAudit(Long id) {
         ProdInOut prodInOut =checkAndReturnOrder(id);
         ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut, ProdInOutDTO.class);
-        String res =  singleUnAudit(prodInOutDTO);
-
+        singleUnAudit(prodInOutDTO);
     }
 
-    private String singleUnAudit(ProdInOutDTO prodInOutDTO) {
+    private void singleUnAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
-        warehouseApi.unPost(map);
-        Object result =  map.get("result");
-        if(result!=null){
-            return result.toString();
+        Result res = warehouseApi.unPost(map);
+        Object result = res.getData();
+        if(!StringUtils.isEmpty(result)){
+            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
             //日志
             messageLogService.unAudit(docBaseDTO);
-            return "";
         }
     }
 
     @Override
-    public void batchUnAudit(BatchDealBaseDTO baseDTOs) {
+    public String batchUnAudit(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
                 baseDTOs.getBaseDTOs().size() == 0) {
-            return;
+            return "无可反审核单据。";
         }
+        StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
-            Long id =  base.getId();
-            ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
-            singleUnAudit(prodInOutDTO);
+            try {
+                Long id =  base.getId();
+                ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+                ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+                singleUnAudit(prodInOutDTO);
+            }catch (Exception e) {
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
         }
+        return errorMsg.toString();
     }
 
     @Override

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

@@ -746,7 +746,7 @@ update prodiodetail a
           and pd_piid=#{id}  GROUP BY pd_ioid ) b
           where IFNULL(b.pd_ioid ,0)= a.pd_id
      ),0)
-where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pi_class='出货单')
+where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pd_piclass='出货单')
   </update>
   <update id="updateSaleYqty" parameterType="long">
 

+ 5 - 4
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
  * Created by zdw
  * 2018-10-17 11:41.
  */
+@CrossOrigin
 @RestController
 @RequestMapping("/prodinout")
 public class ProdInOutController {
@@ -130,8 +131,8 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        prodInOutService.batchAudit(baseDTOs);
-        return Result.success();
+        String res = prodInOutService.batchAudit(baseDTOs);
+        return Result.success(res);
     }
 
     /**
@@ -142,8 +143,8 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        prodInOutService.batchUnAudit(baseDTOs);
-        return Result.success();
+        String res = prodInOutService.batchUnAudit(baseDTOs);
+        return Result.success(res);
     }
 
     /**

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

@@ -30,4 +30,8 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
     List<ProdIODetail> selectByFK(Long id);
 
     void deleteByFK(Long id);
+
+    void calcProdIn(Long pi_id);
+
+    void calcProdOut(Long pi_id);
 }

+ 2 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutService.java

@@ -47,7 +47,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     DocBaseDTO audit(ProdInOutFormDTO formData);
 
-    void batchAudit(BatchDealBaseDTO baseDTOs);
+    String batchAudit(BatchDealBaseDTO baseDTOs);
 
     /**
      * 反审核出入库单
@@ -55,7 +55,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     void unAudit(Long id);
 
-    void batchUnAudit(BatchDealBaseDTO baseDTOs);
+    String batchUnAudit(BatchDealBaseDTO baseDTOs);
 
     void deleteItem(Long id);
 

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.storage.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -185,10 +186,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             prodIODetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
-        //更新已转数
+        //计算金额,未税单价,未税金额等
+        calcProdInout(pi_id,pi_class);
         //日志记录
         messageLogService.update(baseDTO);
-
         return baseDTO;
     }
 
@@ -220,95 +221,101 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         DocBaseDTO baseDTO = new DocBaseDTO();
         if (null != formData) {
             id = formData.getMain().getId();
-            if (StringUtils.isEmpty(id)) {
+            if (StringUtils.isEmpty(id)|| "0".equals(String.valueOf(id))) {
                 baseDTO = saveFormData(formData);
                 id = baseDTO.getId();
             }
-            String res = singleAudit(formData.getMain());
-            if(res!=null){
-                new BizException(501,res);
-            }
+            singleAudit(formData.getMain());
         }
         baseDTO.setId(id);
         return baseDTO;
     }
 
-    private String singleAudit(ProdInOutDTO prodInOutDTO) {
+    private void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
-        warehouseApi.post(map);
-        Object result =  map.get("result");
-        if(result!=null){
-            return result.toString();
+        Result res = warehouseApi.post(map);
+        Object result =  res.getData();
+        if(!StringUtils.isEmpty(result)){
+            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
             //日志
             messageLogService.audit(docBaseDTO);
-            return "";
         }
     }
 
     @Override
-    public void batchAudit(BatchDealBaseDTO baseDTOs) {
+    public String  batchAudit(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
                 baseDTOs.getBaseDTOs().size() == 0) {
-            return;
+            return "没有可审核单据。";
         }
+        StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
-            Long id =  base.getId();
-            ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
-            singleAudit(prodInOutDTO);
+            try {
+                Long id =  base.getId();
+                ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+                ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+                singleAudit(prodInOutDTO);
+            } catch (Exception e){
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
         }
+        return errorMsg.toString();
     }
 
     @Override
     public void unAudit(Long id) {
         ProdInOut prodInOut =checkAndReturnOrder(id);
         ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut, ProdInOutDTO.class);
-        String res =  singleUnAudit(prodInOutDTO);
-
+        singleUnAudit(prodInOutDTO);
     }
 
-    private String singleUnAudit(ProdInOutDTO prodInOutDTO) {
+    private void singleUnAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
-        warehouseApi.unPost(map);
-        Object result =  map.get("result");
-        if(result!=null){
-            return result.toString();
+        Result res = warehouseApi.unPost(map);
+        Object result =  res.getData();
+        if(!StringUtils.isEmpty(result)){
+            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
             //日志
             messageLogService.unAudit(docBaseDTO);
-            return "";
         }
     }
 
     @Override
-    public void batchUnAudit(BatchDealBaseDTO baseDTOs) {
+    public String batchUnAudit(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
                 baseDTOs.getBaseDTOs().size() == 0) {
-            return;
+            return "无可反审核单据。";
         }
+        StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
-            Long id =  base.getId();
-            ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
-            singleUnAudit(prodInOutDTO);
+            try {
+                Long id =  base.getId();
+                ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+                ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+                singleUnAudit(prodInOutDTO);
+            }catch (Exception e) {
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
         }
+        return errorMsg.toString();
     }
 
     @Override
@@ -455,4 +462,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
         return prodInOut;
     }
+
+    private void calcProdInout(Long pi_id, String pi_class) {
+        if ("其它入库单".equals(pi_class)) {
+            prodIODetailMapper.calcProdIn(pi_id);
+        } else if ("其它出库单".equals(pi_class)) {
+            prodIODetailMapper.calcProdOut(pi_id);
+        }
+    }
+
 }

+ 14 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -739,4 +739,18 @@ where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEG
     where pd_piid = #{id,jdbcType=INTEGER}
   </delete>
 
+  <update id="calcProdIn">
+    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodiodetail set pd_total = pd_orderprice*pd_inqty,pd_nettotal = pd_netprice*pd_inqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_total = (select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+  </update>
+
+  <update id="calcProdOut">
+    update prodiodetail set pd_netprice = pd_orderprice/(1+pd_taxrate/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodiodetail set pd_total = pd_orderprice*pd_outqty,pd_nettotal = pd_netprice*pd_outqty where pd_piid = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_total = (select sum(pd_total) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+    update prodinout set pi_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
+  </update>
+
 </mapper>

+ 3 - 5
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -80,6 +80,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                         text: '导入',
                         handler: me.onImport,
                         menu: {
+                            cls:'x-query-menu',
                             width: 80,
                             items: [{
                                 text:'导出',
@@ -100,6 +101,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                             me.onVastDeal(form._batchCloseUrl,'CLOSE');
                         },
                         menu: {
+                            cls:'x-query-menu',
                             width: 80,
                             items: [{
                                 text:'启用',
@@ -128,11 +130,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
-                    emptyMsg: "暂无数据",
-                    store: me.store,
-                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
-                    beforePageText: "当前第",
-                    afterPageText: "页,共{0}页"
+                    store: me.store
                 }]
             });
         }

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

@@ -73,11 +73,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
-                    emptyMsg: "暂无数据",
-                    store: me.store,
-                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
-                    beforePageText: "当前第",
-                    afterPageText: "页,共{0}页"
+                    store: me.store
                 }]
             });
         }

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

@@ -126,11 +126,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
-                    emptyMsg: "暂无数据",
                     store: me.store,
-                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
-                    beforePageText: "当前第",
-                    afterPageText: "页,共{0}页",
                     items:[{
                         xtype:'checkbox',
                         id:'showSelectRecord',

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

@@ -122,6 +122,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     xtype: 'button',
                     handler: me.onAudit,
                     menu: {
+                        cls:'x-query-menu',
                         items: [{
                             text:'反审核',
                             handler:function(){
@@ -138,6 +139,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     text: '打印',
                     handler: me.onPrint,
                     menu: {
+                        cls:'x-query-menu',
                         width: 80,
                         items: [{
                             text:'设置',
@@ -155,6 +157,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     text: '导入',
                     handler: me.onImport,
                     menu: {
+                        cls:'x-query-menu',
                         width: 80,
                         items: [{
                             text:'导出',
@@ -172,6 +175,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     text: '关闭',
                     handler: me.onCloseOrder,
                     menu: {
+                        cls:'x-query-menu',
                         width: 80,
                         items: [{
                             text:'启用',
@@ -193,11 +197,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 xtype: 'pagingtoolbar',
                 dock: 'bottom',
                 displayInfo: true,
-                emptyMsg: "暂无数据",
-                store: me.store,
-                displayMsg: '显示{0}-{1}条,共{2}条',
-                beforePageText: "第",
-                afterPageText: "页,共{0}页"
+                store: me.store
             }]
         });
         me.callParent(arguments);

+ 41 - 0
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -156,6 +156,47 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 name: 'wh_statuscode',
                 value:'OPEN'
             }]
+        },
+        maxnumbers:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                fieldLabel: '单据Caller',
+                name: 'mn_caller',
+                allowBlank:false
+            },{
+                xtype:'textfield',
+                fieldLabel: '单据前缀',
+                name: 'mn_leadcode',
+                allowBlank:false
+            },{
+                xtype:'combo',
+                fieldLabel: '单据规则',
+                name: 'mn_rule',
+                displayField : "display", 
+                editable:false,
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"年月日", "value":'yyyymmdd'},
+                        {"display":"年月", "value":'yyyymm'}
+                    ]
+                }
+            },{
+                xtype:'numberfield',
+                hideTrigger : true, 
+                fieldLabel: '流水长度',
+                name: 'mn_number',
+                allowBlank:false
+            }]
         }
     },
     setFormItems:function() {

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

@@ -167,6 +167,33 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl: '/api/document/address/save',
             delUrl: '/api/document/address/delete'
         },
+        maxnumbers:{
+            columns: [{
+                text : "单据caller", 
+                width : 200.0, 
+                dataIndex : "mn_caller", 
+                xtype : "", 
+            }, 
+            {
+                text : "单据前缀", 
+                dataIndex : "mn_leadcode", 
+                width : 120.0, 
+                xtype : "", 
+            }, 
+            {
+                text : "单据规则", 
+                dataIndex : "mn_rule", 
+                width : 220.0, 
+                xtype : "", 
+            },{
+                text : "流水长度", 
+                dataIndex : "mn_number", 
+                width : 120.0, 
+                xtype : "", 
+            }],
+            keyField:'id',
+            reqUrl:'http://192.168.253.31:8920/number/save'
+        },
         warehouse:{
             columns: [{
                 text: '仓库编号',

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

@@ -147,3 +147,9 @@ $treelist-nav-ui: (
     font-size:14px;
     font-weight: 500;
 }
+.x-query-menu {
+    width:68px !important;
+}
+.x-query-menu .x-menu-item-text-default.x-menu-item-indent-no-separator {
+    margin-left: 11px !important;
+}

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

@@ -27,7 +27,10 @@ Ext.define('saas.view.sale.sale.FormPanel', {
      toolBtns: [{
          xtype: 'button',
          text: '转出货单',
-         handler: 'turnOut'
+         handler: 'turnOut',
+         bind: {
+             hidden: '{sa_statuscode!="AUDITED"}'
+         }
      }],
 
     defaultItems: [{

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

@@ -60,14 +60,14 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
     }, {
         xtype: 'multicombo',
         name: 'sa_sendstatuscode',
-        bind: '{sa_sendstatuscode}',
-        fieldLabel: '出库状态',
+        fieldLabel: '业务状态',
         allowBlank: true,
         columnWidth: 0.25,
         datas: [
             ["TURNOUT", "已出库"],
             ["UNTURNOUT", "未出库"],
-            ["PARTOUT", "部分出库"]
+            ["PARTOUT", "部分出库"],
+            ["CLOSE", "已关闭"]
         ]
     }],
     moreQueryFormItems: [],
@@ -96,9 +96,13 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             dataIndex: 'sa_cuname',
             width: 120
         }, {
-            text: '业务状态',
+            text: '审核状态',
             dataIndex: 'sa_status',
             width: 120
+        }, {
+            text: '业务状态',
+            dataIndex: 'sa_sendstatus',
+            width: 120
         }, {
             text: '单据日期',
             dataIndex: 'sa_recorddate',

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

@@ -164,14 +164,6 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                 format:'0',
                 items : null,
                 summaryType: 'sum'
-            },            {
-                text : "已转数", 
-                dataIndex : "pd_yqty", 
-                width : 120.0, 
-                xtype : "numbercolumn", 
-                format:'0',
-                items : null,
-                summaryType: 'sum'
             },{
                 text : "仓库id", 
                 dataIndex : "pd_whid", 

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

@@ -161,15 +161,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                 format: '0',
                 items: null,
                 summaryType: 'sum'
-            }, {
-                text: "已转数",
-                dataIndex: "pd_yqty",
-                width: 120.0,
-                xtype: "numbercolumn",
-                format: '0',
-                items: null,
-                summaryType: 'sum'
-            }, {
+            },{
                 text: "仓库id",
                 dataIndex: "pd_whid",
                 xtype: "numbercolumn",

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

@@ -0,0 +1,212 @@
+Ext.define('saas.view.sys.finish.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-finish-datalist',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'/api/common/finish/list',
+
+    tbar: [{
+        width: 250,
+        name: 'ml_caller',
+        xtype: 'displayfield',
+        fieldLable : '结账日'
+    },{
+        xtype:'button',
+        text:'结账',
+    },{
+        xtype:'button',
+        text:'反结账',
+    },'->',{
+        cls:'x-formpanel-btn-blue',
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                grid.store.loadPage(1);
+            }
+        }
+    }],
+
+    //字段属性
+    columns : [{
+        text : "id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn",   
+    },{
+        text:'结账日',
+        dataIndex : "ml_caller",
+        xtype:'datecolumn',
+        width : 200.0, 
+    },{
+        text : "操作日期", 
+        width : 200.0, 
+        dataIndex : "ml_code", 
+        xtype:'datecolumn',
+    }, 
+    {
+        text : "操作员", 
+        dataIndex : "ml_content", 
+        width : 220.0, 
+    }],
+
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+     /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d h:i:s') + ',' + Ext.Date.format(new Date(to), 'Y-m-d h:i:s');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+});

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

@@ -4,11 +4,15 @@
 Ext.define('saas.view.sys.maxnumbers.DataList', {
     extend: 'Ext.grid.Panel',
     xtype: 'sys-maxnumbers-datalist',
+    controller: 'sys-maxnumbers-datalist',
+    viewModel: 'sys-maxnumbers-datalist',
     autoScroll: true,
     frame:true,
     layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     dataUrl:'http://192.168.253.31:8920/number/list',
-    saveUrl:'http://192.168.253.31:8920/number/save',
     deleteUrl:'http://192.168.253.31:8920/number/delete/',
 
     tbar: [{
@@ -47,7 +51,24 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
         xtype:'button',
         text:'新增',
         listeners: {
-            click: 'onAdd'
+            click: function(){
+                var document = Ext.create('saas.view.document.kind.Kind',{});
+                var form = this.ownerCt.ownerCt;
+                var grid = this.ownerCt.ownerCt.items.items[0].grid;
+                this.dialog = form.getController().getView().add({
+                    xtype: 'document-kind-childwin',
+                    bind: {
+                        title: '新增单据编码规则'
+                    },
+                    dataKind:'maxnumbers',
+                    belong:document.etc['maxnumbers'],
+                    _parent:form,
+                    _combo:grid,
+                    record:null,
+                    session: true
+                });
+                this.dialog.show();
+            }
         }
     }],
 
@@ -74,7 +95,7 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
         width : 220.0, 
         xtype : "", 
     },{
-        text : "规则长度", 
+        text : "流水长度", 
         dataIndex : "mn_number", 
         width : 120.0, 
         xtype : "", 
@@ -126,11 +147,7 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
-                    emptyMsg: "暂无数据",
-                    store: me.store,
-                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
-                    beforePageText: "当前第",
-                    afterPageText: "页,共{0}页"
+                    store: me.store
                 }]
             });
         }
@@ -168,17 +185,29 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
     listeners:{
         itemClick: function(view,record,a,index,c) {
             var classList = c.target.classList.value;
-            var form = view.ownerCt.ownerCt;
+            var grid = this;
             if(classList.indexOf('fa-pencil')>-1){
-                var config = {};
-                config.initId = record.get('id');
-                openTab(form._formXtype, '修改'+form._title, form._formXtype+config.initId, config);
+                var document = Ext.create('saas.view.document.kind.Kind',{});
+                var form = this.ownerCt;
+                this.dialog = form.getController().getView().add({
+                    xtype: 'document-kind-childwin',
+                    bind: {
+                        title: '修改单据编码规则'
+                    },
+                    dataKind:'maxnumbers',
+                    belong:document.etc['maxnumbers'],
+                    _parent:form,
+                    _combo:this,
+                    record:record,
+                    session: true
+                });
+                this.dialog.show();
             }else if(classList.indexOf('fa-trash-o')>-1){
                 //删除
                 var id = record.get('id');
                 if(id){
-                    form.BaseUtil.request({
-                        url: form._deleteUrl+id,
+                    grid.BaseUtil.request({
+                        url: grid.deleteUrl+id,
                         method: 'POST',
                     })
                     .then(function(localJson) {

+ 10 - 0
frontend/saas-web/app/view/sys/maxnumbers/DataListController.js

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

+ 4 - 0
frontend/saas-web/app/view/sys/maxnumbers/DataListlModel.js

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

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

@@ -5,7 +5,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
     autoScroll: true,
     frame:true,
     layout:'fit',
-    dataUrl:'api/common/messagelog/list',
+    dataUrl:'/api/commons/messagelog/list',
 
     tbar: [{
         width: 150,
@@ -120,30 +120,13 @@ Ext.define('saas.view.sys.messagelog.DataList', {
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
                     displayInfo: true,
-                    emptyMsg: "暂无数据",
-                    store: me.store,
-                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
-                    beforePageText: "当前第",
-                    afterPageText: "页,共{0}页"
+                    store: me.store
                 }]
             });
         }
         me.callParent(arguments);
     },
 
-    getCondition: function(f,conditionExpression){
-        var condition = '';
-        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
-            
-        }else if(f.xtype=='textfield'&&f.value!=''){
-            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
-        }
-        if(condition.length>0){
-            condition+= ' AND ';
-        }
-        return condition;
-    },
-
      /**
      * 获得过滤条件
      */

+ 2 - 1
frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/field/Date.js

@@ -3,8 +3,9 @@
  * 2017年10月12日
  */
 Ext.define('Ext.locale.zh_CN.field.Date', {
-    override: 'Ext.field.Date',
+    override: 'Ext.form.field.Date',
 
+    formatText: '当前日期格式为 {0}.',
     minDateMessage: '该输入项的日期必须在 {0} 之后',
     maxDateMessage: '该输入项的日期必须在 {0} 之前'
 });

+ 20 - 0
frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/grid/pagtoolbar/Paging.js

@@ -0,0 +1,20 @@
+/**
+ * 简体中文 by lovelyelfpop <479858761@qq.com>
+ * 2017年10月16日
+ */
+Ext.define('Ext.locale.zh_CN.grid.pagtoolbar.Paging', {
+    override: 'Ext.toolbar.Paging',
+
+    config: {
+        emptyMsg:'暂无数据',
+        firstText:'首页',
+        prevText:'上一页',
+        nextText:'下一页',
+        lastText:'尾页',
+        refreshText:'刷新',
+        displayMsg: '显示{0}到{1}条数据,共有{2}条',
+        beforePageText: "当前第",
+        afterPageText: "页,共{0}页"
+    }
+});
+

+ 3 - 4
frontend/saas-web/resources/json/navigation.json

@@ -257,15 +257,14 @@
             "viewType": "sys-messagelog-datalist",
             "leaf": true
         }, {
-            "id":"sys-messagelog-datalist",
+            "id":"sys-maxnumbers-datalist",
             "text": "单据编码规则",
             "viewType": "sys-maxnumbers-datalist",
             "leaf": true
         }, {
-            "id":"product-list-formpanel",
+            "id":"sys-finish-datalist",
             "text": "结账/反结账",
-            "viewType": "document-product-basepanel",
-            "addType":"document-product-formpanel",
+            "viewType": "sys-finish-datalist",
             "leaf": true
         }]
     }]