Browse Source

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

chenw 7 years ago
parent
commit
f45fe0d8d3
48 changed files with 503 additions and 189 deletions
  1. 5 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  2. 34 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java
  3. 1 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersdetailMapper.java
  4. 6 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java
  5. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java
  6. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java
  7. 5 11
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  8. 3 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  9. 33 24
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  10. 4 0
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  11. 4 0
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  12. 3 0
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  13. 3 0
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  14. 4 0
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  15. 3 0
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  16. 6 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutDTO.java
  17. 5 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOut.java
  18. 6 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOutList.java
  19. 14 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  20. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  21. 1 0
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  22. 22 1
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  23. 2 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java
  24. 5 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  25. 14 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  26. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java
  27. 11 1
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  28. 7 5
      frontend/saas-web/app/Application.scss
  29. 18 0
      frontend/saas-web/app/model/document/stocking.js
  30. 28 0
      frontend/saas-web/app/model/money/Verification2.js
  31. 0 1
      frontend/saas-web/app/view/core/form/RemoteCombo.js
  32. 5 3
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  33. 22 14
      frontend/saas-web/app/view/document/kind/ChildForm.js
  34. 23 17
      frontend/saas-web/app/view/money/verification/FormPanel.js
  35. 47 17
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  36. 1 7
      frontend/saas-web/app/view/money/verification/FormPanelModel.js
  37. 5 1
      frontend/saas-web/app/view/money/verification/QueryPanel.js
  38. 1 1
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  39. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  40. 2 2
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  41. 2 2
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  42. 95 58
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  43. 13 0
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js
  44. 9 2
      frontend/saas-web/app/view/stock/inventory/EditDataList.js
  45. 15 8
      frontend/saas-web/app/view/sys/account/DataList.js
  46. 4 0
      frontend/saas-web/app/view/sys/manager/FormPanel.scss
  47. 1 1
      frontend/saas-web/app/view/sys/power/GroupGrid.js
  48. BIN
      frontend/saas-web/resources/images/guide/background.png

+ 5 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -82,6 +82,11 @@ public enum Operation {
      */
     TURNPRODOUT("msg.turnProdIO","msg.turnSuccess"),
 
+    /**
+     * 销售转采购
+     */
+    TURNPURCHASE("msg.turnPurchase","msg.turnSuccess"),
+
     /**
      * 转销售验退单
      */

+ 34 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java

@@ -50,10 +50,43 @@ public enum Status {
     /**
      * 未出库
      */
-    UNTURNOUT("未出库");
+    UNTURNOUT("未出库"),
+
+    /**
+     *未收款
+     */
+    RECNONE("未收款"),
+
+    /**
+     * 部分收款
+     */
+    RECPART("部分收款"),
 
 
+    /**
+     * 已收款
+     */
+    RECALL("已收款"),
+
+
+    /**
+     * 未付款
+     */
+    PAYNONE("未付款"),
+
+
+    /**
+     * 部分付款
+     */
+    PAYPART("部分付款"),
+
+    /**
+     * 已付款
+     */
+    PAYALL("已付款")
     ;
+
+
     private String display;
     private Status(String display){
         this.display = display;

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

@@ -18,7 +18,7 @@ public interface MaxnumbersdetailMapper {
 
     int insertSelective(Maxnumbersdetail record);
 
-    Maxnumbersdetail selectByExample(MaxnumbersdetailExample example);
+    List<Maxnumbersdetail> selectByExample(MaxnumbersdetailExample example);
 
     Maxnumbersdetail selectByPrimaryKey(Integer md_id);
 

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

@@ -263,7 +263,12 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
         detailcta.andCompanyIdEqualTo(BaseContextHolder.getCompanyId());
         detailcta.andMd_callerEqualTo(caller);
         detailcta.andMd_leadcodeEqualTo(rulecode);
-        return maxnumbersdetailMapper.selectByExample(detailexample);
+        List<Maxnumbersdetail> details = maxnumbersdetailMapper.selectByExample(detailexample);
+        Maxnumbersdetail detail = null;
+        if (null != details && details.size() > 0) {
+            detail = details.get(0);
+        }
+        return detail;
     }
 
     /**

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

@@ -43,4 +43,6 @@ public interface PaybalanceMapper extends CommonBaseMapper<Paybalance> {
     Double selectThisamount(Integer id);
 
     void updateBankAmount(@Param("bk_thisamount") Double bk_thisamount, @Param("id") Integer id);
+
+    int checkStatus(@Param("id") Long id);
 }

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

@@ -50,4 +50,6 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
     Customer selectCustomerByPrimaryKey(Integer bkId);
 
     int updateCustomerByPrimaryKeySelective(Customer record);
+
+    int checkStatus(@Param("id") Long id);
 }

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

@@ -202,12 +202,8 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         paybalance.setPb_auditman(BaseContextHolder.getUserName());
         paybalance.setPb_auditdate(new Date());
         pay.setMain(paybalance);
-        Subledger subledger = this.changSubledgerUntil(paybalance);
-        if (subledger.getSl_code() == null){
-            subledgerMapper.insertSelective(subledger);
-        }else {
-            subledgerMapper.updateByPrimaryKeySelective(subledger);
-        }
+        this.changSubledgerUntil(paybalance);
+
         this.changBankUntil(pay);
         DocBaseDTO docBaseDTO = this.insert(pay);
         Long id = docBaseDTO.getId();
@@ -508,15 +504,13 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
 
 
     //插入中间表
-    public Subledger changSubledgerUntil(Paybalance paybalance){
+    public void changSubledgerUntil(Paybalance paybalance){
         Subledger subledger = new Subledger();
-//        BeanUtils.copyProperties(subledger, paybalance);
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(paybalance.getPb_code());
         subledger.setSl_kind(paybalance.getPb_kind());
         subledger.setSl_custid(0);
-//        subledger.setSl_vendid(paybalance.getPb_vendid());
-        subledger.setSl_vendid(1);
+        subledger.setSl_vendid(paybalance.getPb_vendid());
         subledger.setSl_date(paybalance.getPb_date());
         subledger.setSl_ym(DateUtils.getYm(paybalance.getPb_date()));
         if (paybalance.getPb_pdamount() == null){
@@ -546,7 +540,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         subledger.setSl_remark(subledger.getSl_remark());
         subledger.setSl_preamount(subledger.getSl_preamount());
 
-        return subledger;
+        subledgerMapper.insertSelective(subledger);
     }
 
     //插入bank中间表

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

@@ -238,12 +238,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         recbalance.setRb_auditman(BaseContextHolder.getUserName());
         recbalance.setRb_auditdate(new Date());
         rec.setMain(recbalance);
-        Subledger subledger = this.changSubledgerUntil(recbalance);
-        if (subledger.getSl_code() == null){
-            subledgerMapper.insertSelective(subledger);
-        }else {
-            subledgerMapper.updateByPrimaryKeySelective(subledger);
-        }
+        this.changSubledgerUntil(recbalance);
         this.changBankUntil(rec);
         DocBaseDTO docBaseDTO = this.insert(rec);
         Long id = docBaseDTO.getId();
@@ -512,7 +507,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
     }
 
     //插入中间表
-    public Subledger changSubledgerUntil(Recbalance recbalance){
+    public void changSubledgerUntil(Recbalance recbalance){
         Subledger subledger = new Subledger();
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(recbalance.getRb_code());
@@ -548,7 +543,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         subledger.setSl_remark(subledger.getSl_remark());
         subledger.setSl_preamount(subledger.getSl_preamount());
 
-        return subledger;
+        subledgerMapper.insertSelective(subledger);
     }
 
     //插入bank中间表

+ 33 - 24
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -135,6 +135,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         if(id.longValue() > 0 ){
             String kind = verification.getVc_kind();
             verification.setVc_kind(transferKind(kind));
+            verification.setCompanyId(companyId);
+            verification.setUpdateTime(new Date());
+            verification.setUpdaterName(BaseContextHolder.getUserName());
+            verification.setUpdaterId(userId);
             verificationMapper.updateByPrimaryKey(verification);
             baseDTO = new DocBaseDTO(id, code, BillCodeSeq.VERIFICATION.getCaller());
             if (!("AUDITED".equals(verification.getVc_statuscode()))) {
@@ -166,6 +170,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             Verificationdet detail = BeanMapper.map(item,Verificationdet.class);
             Long vd_id = detail.getId();
             detail.setVd_vcid(id);
+            detail.setVd_id(Math.toIntExact(vd_id));
             detail.setCompanyId(companyId);
             detail.setVd_ym(numberYM);
             if (vd_id>0){
@@ -174,48 +179,52 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 verificationdetMapper.insertSelective(detail);
             }
         }
-        for (VerificationdetailDTO item : items2) {
-            Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
-            detail.setVcd_vcid(id);
-            detail.setVcd_ym(numberYM);
-            detail.setCompanyId(companyId);
-            Long vcd_id = detail.getId();
-            if(vcd_id>0){
-                verificationdetailMapper.updateByPrimaryKey(detail);
-            }else{
-                verificationdetailMapper.insertSelective(detail);
+        if(items2!=null){
+            for (VerificationdetailDTO item : items2) {
+                Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
+                Long vcd_id = detail.getId();
+                detail.setVcd_vcid(id);
+                detail.setVcd_id(Math.toIntExact(vcd_id));
+                detail.setVcd_ym(numberYM);
+                detail.setCompanyId(companyId);
+                if(vcd_id>0){
+                    verificationdetailMapper.updateByPrimaryKey(detail);
+                }else{
+                    verificationdetailMapper.insertSelective(detail);
+                }
             }
         }
-        updateCorrespondingData(formdata);
+
+        updateCorrespondingData(id);
         return baseDTO;
     }
 
-    private void updateCorrespondingData(VerificationFormDTO formdata) {
+    private void updateCorrespondingData(Long id) {
         //获取主表信息
-        VerificationDTO main = formdata.getMain();
+        Verification main = verificationMapper.selectByPrimaryKey(Math.toIntExact(id));
         //获取从表1
-        List<VerificationdetDTO> items1 = formdata.getItems1();
+        List<Verificationdet> items1 = verificationdetMapper.selectByFK(id);
         //获取从表2
-        List<VerificationdetailDTO> items2 = formdata.getItems2();
+        List<Verificationdetail> items2 = verificationdetailMapper.selectByFK(id);
 
         String type = main.getVc_kind();
         if(type.equals("receipts_offset_receivable") || type.equals("prepaid_offset_payable") ||
                 type.equals("receivable_offset_payable")){
             Double total1 = new Double(0);
-            for(VerificationdetDTO det : items1){
+            for(Verificationdet det : items1){
                 Double nowbalanceDet = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
                 total1 += nowbalanceDet;
 
                 //单据金额
                 Double amount = det.getVd_amount();
                 //核销金额
-                if(amount>0 && nowbalanceDet<0){
+                if(amount.doubleValue()>0 && nowbalanceDet.doubleValue()<0){
                     String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
                     int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
                     String error = String.format(msg, det.getVd_slkind());
                     throw new BizException(code, error);
                 }
-                if(amount<0 && nowbalanceDet>0){
+                if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
                     String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
                     int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
                     String error = String.format(msg, det.getVd_slkind());
@@ -223,20 +232,20 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 }
             }
             Double total2 = new Double(0);
-            for(VerificationdetailDTO detail : items2){
+            for(Verificationdetail detail : items2){
                 Double nowbalanceDet = detail.getVcd_nowbalance()==null?new Double(0):detail.getVcd_nowbalance();
                 total2 += nowbalanceDet;
 
                 //单据金额
                 Double amount = detail.getVcd_amount();
                 //核销金额
-                if(amount>0 && nowbalanceDet<0){
+                if(amount.doubleValue()>0 && nowbalanceDet.doubleValue()<0){
                     String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
                     int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
                     String error = String.format(msg, detail.getVcd_slkind());
                     throw new BizException(code, error);
                 }
-                if(amount<0 && nowbalanceDet>0){
+                if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
                     String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
                     int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
                     String error = String.format(msg, detail.getVcd_slkind());
@@ -247,10 +256,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 throw new BizException(500, BizExceptionCode.VERIFICATION_CHECK_BALANCE.getMessage());
             }
         }else if(type.equals("receivable_to_receivable") || type.equals("payable_to_payable")){
-            for(VerificationdetDTO det : items1){
+            for(Verificationdet det : items1){
                 Double namount = det.getSl_namount()==null?new Double(0):det.getSl_namount();
                 Double nowbalance = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
-                if(namount<nowbalance){
+                if(namount.doubleValue()<nowbalance.doubleValue()){
                     throw new BizException(500, BizExceptionCode.VERIFICATION_CHECK_BALANCE.getMessage());
                 }
             }
@@ -403,7 +412,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     public void deleteDetail1(Long id) {
         if (null != id) {
             Verificationdet verificationdet = verificationdetMapper.selectByPrimaryKey(Integer.valueOf(String.valueOf(id)));
-            Verification verification = verificationMapper.selectByPrimaryKey(verificationdet.getVd_vcid());
+            Verification verification = verificationMapper.selectByPrimaryKey(Math.toIntExact(verificationdet.getVd_vcid()));
             DocBaseDTO baseDTO = new DocBaseDTO();
             baseDTO.setId(id);
             baseDTO.setCode(verification.getVc_code());

+ 4 - 0
applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml

@@ -297,4 +297,8 @@
     from fundtransfer
     where ft_id = #{id,jdbcType=INTEGER}
   </select>
+
+  <select id="checkStatus" resultType="int">
+    select count(1) from fundtransfer where ifnull(ft_statuscode,'')='AUDITED' and ft_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

+ 4 - 0
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -375,4 +375,8 @@
     from othreceipts
     where or_id = #{id,jdbcType=INTEGER}
   </select>
+
+  <select id="checkStatus" resultType="int">
+    select count(1) from othreceipts where ifnull(or_statuscode,'')='AUDITED' and or_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

+ 3 - 0
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -373,4 +373,7 @@
     from othspendings
     where os_id = #{id,jdbcType=INTEGER}
   </select>
+  <select id="checkStatus" resultType="int">
+    select count(1) from othspendings where ifnull(os_statuscode,'')='AUDITED' and os_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

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

@@ -767,4 +767,7 @@
     </set>
     where ve_id = #{id}
   </update>
+  <select id="checkStatus" resultType="int">
+    select count(1) from paybalance where ifnull(pb_statuscode,'')='AUDITED' and pb_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

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

@@ -893,4 +893,8 @@
     </set>
     where cu_id = #{id}
   </update>
+
+  <select id="checkStatus" resultType="int">
+    select count(1) from recbalance where ifnull(rb_statuscode,0)='AUDITED' and rb_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

+ 3 - 0
applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml

@@ -648,4 +648,7 @@
   <select id="validateSetAcount" parameterType="long" resultType="java.lang.String">
     select count(1) from periodsdetail where pd_detno = #{detno} and IFNULL(pd_status,0)=0
   </select>
+  <select id="checkStatus" resultType="int">
+    select count(1) from Verification where ifnull(vc_statuscode,'')='AUDITED' and vc_id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

+ 6 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutDTO.java

@@ -81,4 +81,10 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
 
     private Long pi_maid;
 
+    private String pi_iocode;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
+
 }

+ 5 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOut.java

@@ -77,4 +77,9 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private Long pi_maid;
 
+    private String pi_iocode;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
 }

+ 6 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOutList.java

@@ -144,6 +144,12 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private Long pd_ioid;
 
+    private String pi_iocode;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
+
     //private ProductDTO productDTO;
     private Long pr_id;
     private String pr_code;

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

@@ -142,6 +142,16 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         pi_inoutno = pushMaxnubmer(baseDTO);
         prodInOut.setPi_inoutno(pi_inoutno);
 
+
+        if ("采购验收单".equals(pi_class)){
+            prodInOut.setPi_prstatus(Status.PAYNONE.getDisplay());
+            prodInOut.setPi_prstatuscode(Status.PAYNONE.name());
+        }else if ("采购验退单".equals(pi_class)){
+            prodInOut.setPi_prstatus(Status.RECNONE.getDisplay());
+            prodInOut.setPi_prstatuscode(Status.RECNONE.name());
+        }
+
+
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             prodInOut.setCompanyId(companyId);
@@ -441,6 +451,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_puid(sourcePi.getPi_puid());
         targetPi.setPi_pucode(sourcePi.getPi_pucode());
         targetPi.setPi_ioid(sourcePi.getId());
+        targetPi.setPi_iocode(sourcePi.getPi_inoutno());
+        //设置付款状态
+        targetPi.setPi_prstatus(Status.RECNONE.getDisplay());
+        targetPi.setPi_prstatuscode(Status.RECNONE.name());
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());

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

@@ -438,6 +438,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         prodInOut.setPi_vendname(purchase.getPu_vendname());
         prodInOut.setPi_puid(purchase.getId().intValue());
         prodInOut.setPi_pucode(purchase.getPu_code());
+        //设置付款状态
+        prodInOut.setPi_prstatus(Status.PAYNONE.getDisplay());
+        prodInOut.setPi_prstatuscode(Status.PAYNONE.name());
+
         //设置公司id
         prodInOut.setCompanyId(purchase.getCompanyId());
         prodInOut.setCreatorId(userId);

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

@@ -75,6 +75,7 @@
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
     <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
     <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
     <result column="pr_id" property="pr_id"/>
     <result column="pr_code" property="pr_code"/>

+ 22 - 1
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -40,6 +40,9 @@
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
     <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.purchase.po.ProdInOut">
     <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
@@ -52,7 +55,7 @@
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
     pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
     companyid, updaterid,updaterName,updatetime,creatorid,creatorName,createtime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_auditdate,
-    pi_auditman,pi_remark,pi_ioid
+    pi_auditman,pi_remark,pi_ioid,pi_iocode,pi_prstatus,pi_prstatuscode
   </sql>
   <sql id="Blob_Column_List">
     pi_address
@@ -190,6 +193,15 @@
       <if test="pi_ioid != null">
         pi_ioid,
       </if>
+      <if test="pi_iocode != null">
+        pi_iocode,
+      </if>
+      <if test="pi_prstatus != null">
+        pi_prstatus,
+      </if>
+      <if test="pi_prstatuscode != null">
+        pi_prstatuscode,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -306,6 +318,15 @@
       <if test="pi_ioid != null">
         #{pi_ioid,jdbcType=INTEGER},
       </if>
+      <if test="pi_iocode != null">
+        #{pi_iocode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatus != null">
+        #{pi_prstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatuscode != null">
+        #{pi_prstatuscode,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
 

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

@@ -73,4 +73,6 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
 
     private String pi_remark;
 
+    private String pi_iocode;
+
 }

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

@@ -597,7 +597,11 @@ public class SaleServiceImpl implements SaleService{
         baseDTO.setCode(result);
         baseDTO.setId(Long.valueOf(String.valueOf(purchaseId)));
         baseDTO.setName(BillCodeSeq.PURCHASE.getName());
-        return baseDTO;
+
+
+        DocBaseDTO log = new DocBaseDTO(sale.getId(),sale.getSa_code(),BillCodeSeq.SALE.getCaller());
+        messageLogService.customizeLog(log, Operation.TURNPURCHASE);
+        return log;
     }
 
     //更新最新销售总额

+ 14 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -36,6 +36,8 @@
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+      <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.po.ProdInOut">
     <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
@@ -242,6 +244,12 @@
       <if test="pi_remark != null">
         pi_remark,
       </if>
+      <if test="pi_iocode != null">
+        pi_iocode,
+      </if>
+        <if test="pi_ioid != null">
+            pi_ioid,
+        </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -338,6 +346,12 @@
       <if test="pi_remark != null">
         #{pi_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_iocode != null">
+        #{pi_iocode,jdbcType=LONGVARCHAR},
+      </if>
+        <if test="pi_ioid != null">
+            #{pi_ioid},
+        </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java

@@ -76,4 +76,6 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
     private String pi_macode;
 
     private Long pi_maid;
+
+    private String pi_iocode;
 }

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

@@ -12,6 +12,7 @@ import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.gateway.error.PermissionException;
 import com.usoftchina.saas.gateway.util.AntPathRequestMatcher;
 import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cloud.gateway.filter.GatewayFilterChain;
@@ -74,11 +75,20 @@ public class AuthFilter implements GlobalFilter, Ordered {
     private void checkPermission(ServerHttpRequest request, JwtInfo jwt, AccountDTO accountDTO) {
         if (!accountDTO.isAdmin(jwt.getCompanyId())) {
             // 非管理账户,需要鉴权
+            ResourceCache.current().hdel();
             List<UrlResourceDTO> resources = ResourceCache.current().getUrlResources();
             if (!CollectionUtils.isEmpty(resources)) {
                 // 本次请求相关的资源
                 List<UrlResourceDTO> permissions = resources.parallelStream().filter(resource -> {
-                    AntPathRequestMatcher matcher = new AntPathRequestMatcher(resource.getUrl(), resource.getMethod());
+                    if (StringUtils.isEmpty(resource.getUrl())) {
+                        return false;
+                    }
+                    //处理删除、查询时 url变动无法匹配的问题
+                    String url = resource.getUrl();
+                    if (url.substring(url.length() - 1).equals("/")) {
+                        url += "*";
+                    }
+                    AntPathRequestMatcher matcher = new AntPathRequestMatcher(url, resource.getMethod());
                     return matcher.matches(request);
                 }).collect(Collectors.toList());
                 if (!CollectionUtils.isEmpty(permissions)) {

+ 7 - 5
frontend/saas-web/app/Application.scss

@@ -143,11 +143,14 @@ body.launching {
 }
 
 .x-keyboard-mode .x-btn-focus.x-btn-default-toolbar-small {
-  background: #34BAF6;
-  opacity: 0.72;
+  background: inherit;
+  opacity: 1;
   box-shadow: none;
+  border:1px solid #34BAF6;
 }
+
 .x-keyboard-mode .x-btn-focus.x-btn-over.x-btn-default-toolbar-small {
+  background: #34BAF6;
   box-shadow: none;
 }
 
@@ -179,9 +182,8 @@ body.launching {
 }
 
 .x-formpanel-btn-blue {
-  border-color: #346fb9;
-  background: linear-gradient(to bottom,#3876c3 0,#346fb9 100%) !important;
-
+  background: #34BAF6;
+  border-color: #34BAF6;
   .x-btn-inner-default-toolbar-small{
       color:#fff !important;
   }

+ 18 - 0
frontend/saas-web/app/model/document/stocking.js

@@ -0,0 +1,18 @@
+Ext.define('saas.model.document.stocking', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'st_prodid', type: 'int' },
+        { name: 'st_prodcode', type: 'string' },
+        { name: 'st_proddetail', type: 'string' },
+        { name: 'st_prodorispeccode', type: 'string' },
+        { name: 'st_prodkind', type: 'string' },
+        { name: 'st_produnit', type: 'string' },
+        { name: 'st_whid', type: 'int' },
+        { name: 'st_whcode', type: 'string' },
+        { name: 'st_whname', type: 'string' },
+        { name: 'st_batchqty', type: 'float' },
+        { name: 'st_actqty', type: 'float' },
+        { name: 'st_num', type: 'float' }
+    ]
+});

+ 28 - 0
frontend/saas-web/app/model/money/Verification2.js

@@ -0,0 +1,28 @@
+Ext.define('saas.model.money.Verification2', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'vcd_id', type: 'int' },
+        { name: 'vcd_vcid', type: 'int' },
+        { name: 'vcd_detno', type: 'int' },
+        { name: 'vcd_ym', type: 'int' },
+        { name: 'vcd_slid', type: 'int' },
+        { name: 'vcd_slcode', type: 'string' },
+        { name: 'vcd_slkind', type: 'string' },
+        { name: 'vcd_sldate', type: 'date' },
+        { name: 'vcd_amount', type: 'float' },
+        { name: 'vcd_nowbalance', type: 'float' },
+        { name: 'vcd_remark', type: 'string' },
+        { name: 'companyId', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'vcd_text1', type: 'string' },
+        { name: 'vcd_text2', type: 'string' },
+        { name: 'vcd_text3', type: 'string' },
+        { name: 'vcd_text4', type: 'string' },
+        { name: 'vcd_text5', type: 'string' },
+        { name: 'creator', type: 'string' },
+        { name: 'creatorId', type: 'int' },
+        { name: 'createTime', type: 'date' },
+        { name: 'updater', type: 'string' },
+    ]
+});

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

@@ -32,7 +32,6 @@ Ext.define('saas.view.core.form.RemoteCombo', {
        me.store=store;
     },
     createPicker: function() {
-        debugger
         var me = this,
             picker;
         var count = this.store.getCount();

+ 5 - 3
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -384,9 +384,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         me.editable = able;
 
         Ext.Array.each(columns, function(c) {
-            var e = c.getEditor();
-            if(e) {
-                typeof e.setDisabled == 'function' && e.setDisabled(!able);
+            if(typeof c.getEditor != 'undefined'){
+                var e = c.getEditor();
+                if(e) {
+                    typeof e.setDisabled == 'function' && e.setDisabled(!able);
+                }
             }
         });
     },

+ 22 - 14
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -277,23 +277,37 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 regexText:'请输入正确的手机号码',
                 listeners:{
                     blur:function(f,a,b,c){
+                        var form = f.ownerCt;
+                        form.setLoading(true);
                         if(f.value&&f.value!=''&&f.isValid()){
                             Ext.Ajax.request({
-                                url: 'http://192.168.253.31:8560/api/account/account/checkMobile?mobile='+f.value,
+                                url: '/api/account/account/checkMobile?mobile='+f.value,
                                 method: 'GET',
                                 headers:{
                                     'Access-Control-Allow-Origin': '*',
                                     "Content-Type": 'application/json;charset=UTF-8'
                                 },
                                 success: function (response) {
+                                    form.setLoading(false);
+                                    var localJson = Ext.decode(response.responseText);
                                     if(localJson.success){
-                                        saas.util.BaseUtil.showSuccessToast('保存成功');
-                                        form.ownerCt._parent.store.load()
-                                        form.ownerCt.close();
+                                        if(!localJson.data.hasRegister){
+                                            saas.util.BaseUtil.showSuccessToast('校验成功:手机号未被注册');
+                                        }else{
+                                            saas.util.BaseUtil.showErrorToast('校验失败:手机号已被注册');
+                                            f.setValue('');
+                                        }
+                                    }else{
+                                        saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
                                     }
                                 },
                                 failure: function (response) {
-                                    debugger
+                                    if(response.responseText){
+                                        var localJson = Ext.decode(response.responseText);
+                                        saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
+                                    }else{
+                                        saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
+                                    }
                                 }
                             });
                         }
@@ -310,6 +324,8 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 fieldLabel: '邮箱',
                 name: 'email',
                 allowBlank:false,
+                regex:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
+                regexText:'请输入正确的邮箱',
                 maxLength: 30,
             }]
         },
@@ -646,15 +662,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         .then(function(localJson) {
             me.setLoading(false);
             if(localJson.success){
-                var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
-                if(grid){
-                    grid.store.load();
-                }
-                if(combo){
-                    combo.store.load(function() {
-                        typeof combo.setValue == 'function' && combo.setValue(params._value);
-                    });
-                }
+                form.ownerCt._parent.store.load();
                 saas.util.BaseUtil.showSuccessToast('保存成功');
                 form.ownerCt.close();
             }

+ 23 - 17
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -49,12 +49,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
             ],
             listeners:{
                 beforerender:function(f){
-                    f.firstLoad=true;
-                },
-                change:function(f){
-                    if(f.bindError){
-                        f.setValue(f.defaultValue);
-                        f.bindError = false
+                    f.firstLoad = true;
+                    if(f.ownerCt.initId!=0){
+                        f.setReadOnly(true);
+                        f.setDisabled(true);
                     }
                 }
             }
@@ -183,7 +181,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
         },
         detail2: {
             xtype: "detailGridField",
-            storeModel: 'saas.model.money.Verification1',
+            storeModel: 'saas.model.money.Verification2',
             detnoColumn: 'vcd_detno',
             deleteDetailUrl: '/api/money/verification/deleteDetail2',
             columnWidth: 1,
@@ -327,6 +325,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 fieldLabel: '客户名称',
                 xtype: 'customerDbfindTrigger',
                 name: 'vc_custname',
+                allowBlank : false
             }, {
                 fieldLabel: '日期',
                 xtype: 'datefield',
@@ -400,7 +399,8 @@ Ext.define('saas.view.money.verification.FormPanel', {
             }, {
                 fieldLabel: '客户名称',
                 xtype: 'customerDbfindTrigger',
-                name: 'vc_custname'
+                name: 'vc_custname',
+                allowBlank : false,
             }, {
                 xtype: 'hidden',
                 name: 'vc_vendid',
@@ -440,7 +440,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
             main: [{
                 fieldLabel: '转出客户',
                 xtype: 'textfield',
-                name: 'vc_outcustid',
+                name: 'vc_custid',
                 hidden: true,
                 listeners: {
                     change: 'clearDetail0'
@@ -448,12 +448,13 @@ Ext.define('saas.view.money.verification.FormPanel', {
             }, {
                 fieldLabel: '转出客户编号',
                 xtype: 'textfield',
-                name: 'vc_outcustcode',
+                name: 'vc_custcode',
                 hidden: true
             }, {
                 fieldLabel: '转出客户',
                 xtype: 'customerDbfindTrigger',
-                name: 'vc_outcustname'
+                name: 'vc_custname',
+                allowBlank : false,
             }, {
                 fieldLabel: '转入客户id',
                 xtype: 'textfield',
@@ -468,6 +469,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 fieldLabel: '转入客户',
                 xtype: 'customerDbfindTrigger',
                 name: 'vc_turncustname',
+                allowBlank : false,
             }, {
                 fieldLabel: '日期',
                 xtype: 'datefield',
@@ -491,7 +493,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
             main: [{
                 fieldLabel: '转出供应商',
                 xtype: 'textfield',
-                name: 'vc_outvendid',
+                name: 'vc_vendid',
                 hidden: true,
                 listeners: {
                     change: 'clearDetail0'
@@ -499,12 +501,13 @@ Ext.define('saas.view.money.verification.FormPanel', {
             }, {
                 fieldLabel: '转出供应商编号',
                 xtype: 'textfield',
-                name: 'vc_outvendcode',
+                name: 'vc_vendcode',
                 hidden: true
             }, {
                 fieldLabel: '转出供应商',
                 xtype: 'vendorDbfindTrigger',
-                name: 'vc_outvendname'
+                name: 'vc_vendname',
+                allowBlank : false,
             }, {
                 fieldLabel: '转入供应商id',
                 xtype: 'textfield',
@@ -519,6 +522,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 fieldLabel: '转入供应商',
                 xtype: 'vendorDbfindTrigger',
                 name: 'vc_turnvendname',
+                allowBlank : false,
             }, {
                 fieldLabel: '日期',
                 xtype: 'datefield',
@@ -544,8 +548,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
             receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
-            receivable_to_receivable: ['ifnull(sl_custid,0)={vc_outcustid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
-            payable_to_payable: ['ifnull(sl_vendtid,0)={vc_outvendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0']
+            receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+            'and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
+            payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+            'and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')']
         }
     },
 
@@ -599,7 +605,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 FormUtil.loadData(me);
             })
             .catch(function(response) {
-                saas.util.BaseUtil.showToast('错误:' + response.message);
+                saas.util.BaseUtil.showErrorToast('错误:' + response.message);
                 console.error(response);
             });
         }

+ 47 - 17
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -21,22 +21,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
 
                 }
             },
-            // 转出客户
-            'dbfindtrigger[name=vc_outcustname]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        //赋值 
-                        dbfinds:[{
-                            from: 'id', to: 'vc_outcustid',ignore:true
-                        }, {
-                            from:'cu_code', to:'vc_outcustcode'
-                        },{
-                            from:'cu_name', to:'vc_outcustname'
-                        }],
-                    }) ;   
-
-                }
-            },
             // 转入客户
             'dbfindtrigger[name=vc_turncustname]':{
                 beforerender:function(f){
@@ -97,7 +81,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                     Ext.apply(f, {
                         dbfinds: [{
                             from: 'id',
-                            to: 'vc_turncustid',
+                            to: 'vc_turnvendid',
                             ignore: true
                         }, {
                             from: 've_code',
@@ -309,4 +293,50 @@ Ext.define('saas.view.money.verification.FormPanelController', {
 
         me.save();
     },
+
+    save:function(){
+        var me = this,
+        form = this.getView(),
+        detailCount = form.detailCount,
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData();
+
+        //form里面数据
+        var formData = form.getDirtyData();
+
+        var params = {
+            main:formData.main
+        };
+
+        for(var i = 0; i < detailCount; i++) {
+            params['items' + ( i + 1)] = formData['detail' + i];
+        }
+
+        saas.util.BaseUtil.request({
+            url: form._saveUrl,
+            params: JSON.stringify(params),
+            method: 'POST',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                var id = localJson.data.id;
+                var code = localJson.data.code;
+                form.initId = id;
+                saas.util.FormUtil.loadData(form);
+                saas.util.BaseUtil.showSuccessToast('保存成功');
+
+                var newId = form.xtype + '-' + id;
+                var newTitle = form._title + '(' + code + ')';
+
+                saas.util.BaseUtil.refreshTabTitle(newId, newTitle);
+
+                form.fireEvent('aftersave', true, form, localJson);
+            }
+        })
+        .catch(function(res) {
+            console.error(res);
+            saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
+            form.fireEvent('aftersave', false, form, res);
+        });
+    }
 });

+ 1 - 7
frontend/saas-web/app/view/money/verification/FormPanelModel.js

@@ -14,14 +14,8 @@ Ext.define('saas.view.money.verification.FormPanelModel', {
                 }
                 if(vc_kind.firstLoad){
                     vc_kind.firstLoad = false;
-                    if(vc_kind.defaultValue!=v&&vc_kind.defaultValue==vc_kind.value){
-                        vc_kind.bindError = true;
-                        return vc_kind.value;
-                    }
-                }else{
-                    return v;
                 }
-                
+                return v;
             }
         }
     }

+ 5 - 1
frontend/saas-web/app/view/money/verification/QueryPanel.js

@@ -117,9 +117,13 @@ Ext.define('saas.view.money.verification.QueryPanel', {
         }, {
             text: '客户名称',
             dataIndex: 'vc_custname',
+        }, {
+            text: '供应商编号',
+            dataIndex: 'vc_vendcode',
+            hidden: true
         }, {
             text: '供应商名称',
-            dataIndex: 'vc_vendcode'
+            dataIndex: 'vc_vendname'
         }, {
             text: '核销金额',
             dataIndex: 'vc_amount1',

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

@@ -64,7 +64,7 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
         form = me.getView(),
         id = form.getForm().findField(form._idField);
         saas.util.BaseUtil.request({
-            url: form._turnInUrl+id.value,
+            url: form._turnInUrl+'/'+id.value,
             method: 'POST',
         })
         .then(function(localJson) {

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

@@ -99,7 +99,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
         form = me.getView(),
         id = form.getForm().findField(form._idField);
         saas.util.BaseUtil.request({
-            url: form._turnOutUrl+id.value,
+            url: form._turnOutUrl+'/'+id.value,
             method: 'POST',
         })
         .then(function(localJson) {

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

@@ -63,7 +63,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
         form = me.getView(),
         id = form.getForm().findField(form._idField);
         saas.util.BaseUtil.request({
-            url: form._turnOutUrl+id.value,
+            url: form._turnOutUrl+'/'+id.value,
             method: 'POST',
         })
         .then(function(localJson) {
@@ -88,7 +88,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
             form = me.getView(),
             id = form.getForm().findField(form._idField);
         saas.util.BaseUtil.request({
-            url: form._turnPurchase+id.value,
+            url: form._turnPurchase+'/'+id.value,
             method: 'POST',
         })
             .then(function(localJson) {

+ 2 - 2
frontend/saas-web/app/view/sale/saleOut/FormPanelController.js

@@ -60,7 +60,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
         form = me.getView(),
         id = form.getForm().findField(form._idField);
         saas.util.BaseUtil.request({
-            url: form._turnInUrl+id.value,
+            url: form._turnInUrl + '/' + id.value,
             method: 'POST',
         })
         .then(function(localJson) {
@@ -76,7 +76,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
             }
         })
         .catch(function(res) {
-            console.error(res);
+           // console.error(res);
             saas.util.BaseUtil.showErrorToast('转单失败: ' + res.message);
         });
      }

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

@@ -19,9 +19,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         emptyText:'请输入单号或物料',
         showDetail: true,
         getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
+            if(value != '') {
                 return  ' (pi_inoutno like\'%' + value + '%\' or pd_prodcode like \'%'+value+'%\' ) ';
             }
         }
@@ -38,6 +36,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         allowBlank: true,
         editable:false,
         columnWidth: 0.25,
+        showDetail: true,
         queryMode: 'local',
         emptyText :'全部',
         editable:false,
@@ -59,15 +58,13 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             }
         }
     },{
-        xtype: 'textfield',
+        xtype: 'warehouseDbfindTrigger',
         name: 'pd_whcode',
         fieldLabel: '仓库',
         emptyText :'请输入仓库名或仓库编号',
         showDetail: true,
         getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
+            if(value != '') {
                 return  ' (pd_whcode like\'%' + value + '%\' or pd_whname like \'%'+value+'%\' or pd_inwhcode like\'%' + value + '%\' or pd_inwhname like \'%'+value+'%\') ';
             }
         }
@@ -102,14 +99,6 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             text: '状态',
             dataIndex: 'pi_status',
             width: 90
-        },{
-            text: '供应商名称',
-            dataIndex: 'pi_vendname',
-            width: 0
-        },{
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 0
         },{
             text: '录入人',
             dataIndex: 'creatorName',
@@ -123,48 +112,96 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             dataIndex: 'pi_remark',
             width: 250
         }],
-        relativeColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true,
-            xtype: 'numbercolumn'
-        }, {
-            text: '调拨单号',
-            dataIndex: 'pi_inoutno',
-            width: 150
-        },{
-            text: '单据类型',
-            dataIndex: 'pi_class',
-            width: 0
-        },{
-            text: '单据日期',
-            dataIndex: 'pi_date',
-            xtype:'datecolumn',
-            width: 110
-        },{
-            text: '状态',
-            dataIndex: 'pi_status',
-            width: 90
-        },{
-            text: '供应商名称',
-            dataIndex: 'pi_vendname',
-            width: 0
-        },{
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 0
-        },{
-            text: '录入人',
-            dataIndex: 'creatorName',
-            width: 110
-        },{
-            text: '审核人',
-            dataIndex: 'pi_auditman',
-            width: 110
-        },{
-            text: '备注',
-            dataIndex: 'pi_remark',
-            width: 250
-        }]
+        relativeColumn: [
+            {
+                text: 'id',
+                dataIndex: 'pi_id',
+                xtype: 'numbercolumn',
+                hidden:true
+            },{
+                text: '调拨单号',
+                dataIndex: 'pi_inoutno',
+                width: 150
+            },{
+                text: '单据类型',
+                dataIndex: 'pi_class',
+                width: 0
+            },{
+                text: '单据日期',
+                dataIndex: 'pi_date',
+                xtype:'datecolumn',
+                width: 110
+            },{
+                text: '状态',
+                dataIndex: 'pi_status',
+                width: 90
+            },{
+                text: '序号',
+                dataIndex: 'pd_pdno',
+                width: 80
+            },{
+                text: '相关单号',
+                dataIndex: 'pd_ordercode',
+                width: 150
+            },{
+                text: '物料编号',
+                dataIndex: 'pd_prodcode',
+                width: 150
+            },{
+                text: '物料名称',
+                dataIndex: 'pr_detail',
+                width: 200
+            },{
+                text: '物料规格',
+                dataIndex: 'pr_spec',
+                width: 150
+            },{
+                text: '单位',
+                dataIndex: 'pr_unit',
+                width: 80
+            },{
+                text: '数量',
+                dataIndex: 'pd_inqty',
+                xtype:'numbercolumn',
+                width: 10
+            },{
+                text: '仓库',
+                dataIndex: 'pd_whname',
+                width: 150
+            },{
+                text: '单价',
+                dataIndex: 'pd_orderprice',
+                xtype:'numbercolumn',
+                width: 110,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }         
+            },{
+                text: '税率',
+                dataIndex: 'pd_taxrate',
+                xtype:'numbercolumn',
+                width: 80,            
+                renderer : function(v) {
+                    return Ext.util.Format.number(v, '0');
+                },
+            },{
+                text: '金额',
+                dataIndex: 'pd_total',
+                xtype:'numbercolumn',            
+                width: 110,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
+            },{
+                text: '备注',
+                dataIndex: 'pd_remark',
+                width:250
+            }]
     }
 });

+ 13 - 0
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js

@@ -5,6 +5,19 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
     init: function (form) {
         var me = this;
         this.control({
+             //放大镜赋值关系 以及 tpl模板
+            'warehouseDbfindTrigger[name=pd_whcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dbfinds:[{
+                            from:'wh_code',to:'pd_whcode'                          
+                        },{
+                            from:'wh_description',to:'pd_whname'
+                        }],
+                    }) ;   
+
+                }
+            }
         });
 
     }

+ 9 - 2
frontend/saas-web/app/view/stock/inventory/EditDataList.js

@@ -50,7 +50,7 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         }],
         width:150,
     },{
-        editable:false,
+        editable:true,
         xtype : "remotecombo", 
         storeUrl:'/api/document/producttype/getCombo',
         name : "pr_kind",
@@ -223,7 +223,13 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         text : "盘盈盘亏", 
         dataIndex : "st_num", 
         width : 110.0, 
-        xtype : "numbercolumn", 
+        xtype : "numbercolumn",
+        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);
+        }  
     }],
 
     condition:'',
@@ -245,6 +251,7 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
             me.store = Ext.create('Ext.data.Store',{
+                model:'saas.model.document.stocking',
                 fields:fields,
                 autoLoad: true,
                 pageSize: 11,

+ 15 - 8
frontend/saas-web/app/view/sys/account/DataList.js

@@ -9,7 +9,9 @@ Ext.define('saas.view.sys.account.DataList', {
     autoScroll: true,
     frame:true,
     layout:'fit',
-    dataUrl:'/api/account/account/accountRole/list',                 
+    dataUrl:'/api/account/account/accountRole/list',   
+    _openUrl:'/api/account/account/enable',
+    _closeUrl:'/api/account/account/disable',              
 
     tbar: [{
         width: 150,
@@ -22,7 +24,6 @@ Ext.define('saas.view.sys.account.DataList', {
         xtype: 'textfield',
         emptyText : '电话'
     },{
-        cls:'x-formpanel-btn-orange',
         xtype:'button',
         text:'查询',
         listeners: {
@@ -99,14 +100,14 @@ Ext.define('saas.view.sys.account.DataList', {
         width : 220.0
     },{
         text: '账户状态',
-        dataIndex: 'em_class',
+        dataIndex: 'enabled',
         width:90,
         xtype: 'actioncolumn',
         align : 'center',
         items: [{
             iconCls:'',
             getClass: function(v, meta, rec) {
-                if(rec.get('em_class')=='正式'){
+                if(rec.get('enabled')){
                     return 'x-grid-checkcolumn-checked-btn';
                 }else{
                     return 'x-grid-checkcolumn-btn';
@@ -114,14 +115,20 @@ Ext.define('saas.view.sys.account.DataList', {
             },
             handler: function(view, rowIndex, colIndex) {
                 var rec = view.getStore().getAt(rowIndex);
-                var type=rec.get('em_class')=='正式'?true:false;
+                var type=rec.get('enabled');
                 //  禁用/启用
-                var form = this.ownerCt.ownerCt.ownerCt;
                 var grid = this.ownerCt.ownerCt;
+                var params = {
+                    accountId:rec.get('id')
+                };
                 saas.util.BaseUtil.request({
-                    url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
-                    params: '',
+                    url: (!type?grid._openUrl:grid._closeUrl),
+                    params: params,
                     method: 'POST',
+                    headers : {
+                        'Access-Control-Allow-Origin': '*',
+                        "Content-Type":'application/x-www-form-urlencoded'
+                    }
                 })
                 .then(function(localJson) {
                     if(localJson.success){

+ 4 - 0
frontend/saas-web/app/view/sys/manager/FormPanel.scss

@@ -65,4 +65,8 @@
         content: '';
         border:none !important;
     }
+    .x-btn-over.x-btn-default-toolbar-small {
+        background: #34BAF6 !important;
+        opacity: 0.72;
+      }
 }

+ 1 - 1
frontend/saas-web/app/view/sys/power/GroupGrid.js

@@ -12,7 +12,7 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         text:'保存',
         name:'savepower',
         margin:'0 10 0 2',
-        style:'background:#34baf6;border-color:#cccccc'
+        style:'background:#fff;border-color:#34baf6'
     }],
     features : [Ext.create('Ext.grid.feature.Grouping',{
         collapseTip:null,

BIN
frontend/saas-web/resources/images/guide/background.png