Selaa lähdekoodia

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

guq 7 vuotta sitten
vanhempi
commit
c1bd3f251b
30 muutettua tiedostoa jossa 602 lisäystä ja 150 poistoa
  1. 4 44
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  2. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  3. 4 12
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  4. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java
  5. 44 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VendorAdd.java
  6. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  7. 4 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  8. 4 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  9. 11 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  10. 11 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  11. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  12. 15 0
      applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml
  13. 55 0
      framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java
  14. 1 1
      frontend/saas-web/app/view/core/base/GridPanel.js
  15. 2 1
      frontend/saas-web/app/view/core/form/DataMultiCombo.js
  16. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  17. 1 1
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  18. 57 2
      frontend/saas-web/app/view/document/kind/ChildForm.js
  19. 10 0
      frontend/saas-web/app/view/document/kind/Kind.js
  20. 233 20
      frontend/saas-web/app/view/money/report/AccountDetails.js
  21. 27 21
      frontend/saas-web/app/view/money/report/AccountDetailsController.js
  22. 1 1
      frontend/saas-web/app/view/money/report/AccountDetailsMode.js
  23. 16 4
      frontend/saas-web/app/view/money/verification/FormPanel.js
  24. 14 3
      frontend/saas-web/app/view/money/verification/FormPanelModel.js
  25. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  26. 2 5
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  27. 2 3
      frontend/saas-web/app/view/stock/stockamount/DataList.js
  28. 52 2
      frontend/saas-web/app/view/sys/account/DataList.js
  29. 22 1
      frontend/saas-web/app/view/sys/account/DataListController.js
  30. 0 5
      frontend/saas-web/resources/json/navigation.json

+ 4 - 44
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -23,6 +23,7 @@ import com.usoftchina.saas.document.service.CustomerService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -266,29 +267,21 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         //插入中间表
         Double amount = (customer.getCu_beginaramount() == null ? new Double(0) : customer.getCu_beginaramount())
                 - (customer.getCu_beginprerecamount() == null ? new Double(0) : customer.getCu_beginprerecamount());
-        if (amount != new Double(0)){
             Subledger subledger = new Subledger();
             subledger.setSl_code("期初余额");
             subledger.setSl_kind("期初余额");
             subledger.setSl_vendid(0);
             subledger.setSl_custid(Math.toIntExact(customer.getId()));
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            String dates = date2String(customer.getCu_begindate(), "yyyy-MM");
-            dates = dates + "-01";
-            Date date = null;
-            try {
-                date = string2Date(dates, "yyyy-MM-dd");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            subledger.setSl_date(date);
+            subledger.setSl_date(DateUtils.getFirstDay(customer.getCu_begindate()));
+            subledger.setSl_ym(DateUtils.getYm(customer.getCu_begindate()));
             if (amount > new Double(0)){
                 subledger.setSl_amount(amount);
             }else {
                 subledger.setSl_preamount(amount);
             }
             subledger.setSl_orderamount(Math.abs(amount));
-            subledger.setSl_namount(amount);
+            subledger.setSl_namount(Math.abs(amount));
 
             Subledger subledger1 = subledgerMapper.selectByKindCodeCustid("期初余额","期初余额",
                     Math.toIntExact(customer.getId()));
@@ -297,7 +290,6 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             }else {
                 subledgerMapper.updateByPrimaryKeySelective(subledger);
             }
-        }
 
         baseDTO = getBaseDTOById(cu_id);
         //日志记录
@@ -503,38 +495,6 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return cu_code;
     }
 
-    /**
-     * String转Date类型
-     *
-     * @param dateStr
-     *            时间字符串
-     * @return Date类型时间
-     * @throws Exception
-     *             异常
-     */
-    public static Date string2Date(String dateStr, String format) throws Exception {
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        if (dateStr != null) {
-            return sdf.parse(dateStr);
-        }else {
-            return null;
-        }
-    }
 
-    /**
-     * Date转String
-     *
-     * @param date
-     *            Date类型时间
-     * @return 时间字符串
-     */
-    public static String date2String(Date date, String format) {
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        if (date != null) {
-            return sdf.format(date);
-        }else {
-            return null;
-        }
-    }
 
 }

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

@@ -13,6 +13,7 @@ import com.usoftchina.saas.document.service.FundinouttypeService;
 import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.Date;
@@ -66,6 +67,7 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      * @param id
      * @return
      */
+    @Transactional
     @Override
     public boolean removeByPrimaryKey(Long id){
         Fundinouttype fundinouttype = getMapper().selectByPrimaryKey(id);

+ 4 - 12
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java

@@ -26,6 +26,7 @@ import com.usoftchina.saas.document.mapper.VendorcontactMapper;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -220,29 +221,21 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         //插入中间表
         Double amount = (main.getVe_beginapamount() == null ? new Double(0) : main.getVe_beginapamount())
                 - (main.getVe_beginprepayamount() == null ? new Double(0) : main.getVe_beginprepayamount());
-        if (amount != new Double(0)){
             Subledger subledger = new Subledger();
             subledger.setSl_code("期初余额");
             subledger.setSl_kind("期初余额");
             subledger.setSl_vendid(Math.toIntExact(main.getId()));
             subledger.setSl_custid(0);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            String dates = date2String(main.getVe_begindate(), "yyyy-MM");
-            dates = dates + "-01";
-            Date date = null;
-            try {
-                date = string2Date(dates, "yyyy-MM-dd");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            subledger.setSl_date(date);
+            subledger.setSl_date(DateUtils.getFirstDay(main.getVe_begindate()));
+            subledger.setSl_ym(DateUtils.getYm(main.getVe_begindate()));
             if (amount > new Double(0)){
                 subledger.setSl_amount(amount);
             }else {
                 subledger.setSl_preamount(amount);
             }
             subledger.setSl_orderamount(Math.abs(amount));
-            subledger.setSl_namount(amount);
+            subledger.setSl_namount(Math.abs(amount));
 
             Subledger subledger1 = subledgerMapper.selectByKindCodeVendid("期初余额","期初余额",
                     Math.toIntExact(main.getId()));
@@ -251,7 +244,6 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             }else {
                 subledgerMapper.updateByPrimaryKeySelective(subledger);
             }
-        }
 
         return generateMsgObj(main.getId(), code);
     }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Recbalance;
 import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.money.po.VendorAdd;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.PostMapping;
 
@@ -26,4 +27,5 @@ public interface SubledgerMapper {
     int updateByPrimaryKey(Subledger record);
 
     List<Subledger> selectSubledgerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    VendorAdd selectAdd(@Param("sl_vendid") Integer sl_vendid, @Param("sl_ym") Integer sl_ym);
 }

+ 44 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VendorAdd.java

@@ -0,0 +1,44 @@
+package com.usoftchina.saas.money.po;
+
+/**
+ * @author heqw
+ * @date 2018/11/23 11:44
+ **/
+public class VendorAdd {
+    private Double beginamount;
+    private Double nowamount;
+    private Double nowpay;
+    private Double nowbalance;
+
+    public Double getBeginamount() {
+        return beginamount;
+    }
+
+    public void setBeginamount(Double beginamount) {
+        this.beginamount = beginamount;
+    }
+
+    public Double getNowamount() {
+        return nowamount;
+    }
+
+    public void setNowamount(Double nowamount) {
+        this.nowamount = nowamount;
+    }
+
+    public Double getNowpay() {
+        return nowpay;
+    }
+
+    public void setNowpay(Double nowpay) {
+        this.nowpay = nowpay;
+    }
+
+    public Double getNowbalance() {
+        return nowbalance;
+    }
+
+    public void setNowbalance(Double nowbalance) {
+        this.nowbalance = nowbalance;
+    }
+}

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -290,8 +290,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             fundtransfer.setFt_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             fundtransfer.setFt_statuscode(Status.AUDITED.name());
             Fundtran fundtran = this.select(Math.toIntExact(fundtransfer.getId()));
-            this.changBankUntil(fundtran);
-            this.insert(fundtran);
+//            this.changBankUntil(fundtran);
+            this.audit(fundtran);
 //            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }
     }

+ 4 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.OthreceiptsService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -172,6 +173,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             subledger.setSl_custid(othreceipts.getOr_custid());
             subledger.setSl_vendid(0);
             subledger.setSl_date(othreceipts.getOr_date());
+            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
             subledger.setSl_amount(or_amount);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
             subledgerMapper.insertSelective(subledger);
@@ -340,8 +342,8 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             othreceipts.setOr_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             othreceipts.setOr_statuscode(Status.AUDITED.name());
             Othte othte = this.select(Math.toIntExact(othreceipts.getId()));
-            this.changBankUntil(othte);
-            this.insert(othte);
+//            this.changBankUntil(othte);
+            this.audit(othte);
 //            othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }
     }

+ 4 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java

@@ -17,6 +17,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.OthspendingsService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -209,6 +210,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             subledger.setSl_custid(0);
             subledger.setSl_vendid(othspendings.getOs_vendid());
             subledger.setSl_date(othspendings.getOs_date());
+            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
             subledger.setSl_amount(bk_amount);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
             subledgerMapper.insertSelective(subledger);
@@ -335,8 +337,8 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             othspendings.setOs_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             othspendings.setOs_statuscode(Status.AUDITED.name());
             Othsp othsp = this.select(Math.toIntExact(othspendings.getId()));
-            this.changBankUntil(othsp);
-            this.insert(othsp);
+//            this.changBankUntil(othsp);
+            this.audit(othsp);
 //            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }
     }

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -445,14 +446,15 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             paybalance.setPb_statuscode(Status.AUDITED.name());
             Pay pay = this.select(Math.toIntExact(paybalance.getId()));
-            Subledger subledger = this.changSubledgerUntil(pay.getMain());
-            if (subledger.getSl_code() == null){
-                subledgerMapper.insertSelective(subledger);
-            }else {
-                subledgerMapper.updateByPrimaryKeySelective(subledger);
-            }
-            this.changBankUntil(pay);
-            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
+            this.audit(pay);
+//            Subledger subledger = this.changSubledgerUntil(pay.getMain());
+//            if (subledger.getSl_code() == null){
+//                subledgerMapper.insertSelective(subledger);
+//            }else {
+//                subledgerMapper.updateByPrimaryKeySelective(subledger);
+//            }
+//            this.changBankUntil(pay);
+//            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         }
     }
 
@@ -516,6 +518,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
 //        subledger.setSl_vendid(paybalance.getPb_vendid());
         subledger.setSl_vendid(1);
         subledger.setSl_date(paybalance.getPb_date());
+        subledger.setSl_ym(DateUtils.getYm(paybalance.getPb_date()));
         if (paybalance.getPb_pdamount() == null){
             subledger.setSl_amount((double) 0);
         }else {

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.RecbalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -450,14 +451,15 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             recbalance.setRb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             recbalance.setRb_statuscode(Status.AUDITED.name());
             Rec rec = this.select(Math.toIntExact(recbalance.getId()));
-            Subledger subledger = this.changSubledgerUntil(rec.getMain());
-            if (subledger.getSl_code() == null){
-                subledgerMapper.insertSelective(subledger);
-            }else {
-                subledgerMapper.updateByPrimaryKeySelective(subledger);
-            }
-            this.changBankUntil(rec);
-            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
+            this.audit(rec);
+//            Subledger subledger = this.changSubledgerUntil(rec.getMain());
+//            if (subledger.getSl_code() == null){
+//                subledgerMapper.insertSelective(subledger);
+//            }else {
+//                subledgerMapper.updateByPrimaryKeySelective(subledger);
+//            }
+//            this.changBankUntil(rec);
+//            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
     }
 
@@ -518,6 +520,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         subledger.setSl_custid(recbalance.getRb_custid());
         subledger.setSl_vendid(0);
         subledger.setSl_date(recbalance.getRb_date());
+        subledger.setSl_ym(DateUtils.getYm(recbalance.getRb_date()));
         if (recbalance.getRb_rdamount() == null){
             subledger.setSl_amount((double) 0);
         }else {

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

@@ -695,6 +695,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateResAuditCustomer(VerificationDTO verificationDTO){
         String kind = verificationDTO.getVc_kind();
+        kind = transferKind(kind);
         if(kind.equals("receipts_offset_receivable")){
             Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
             Double preamount = customerData.getCu_preamount()==null?new Double(0):customerData.getCu_preamount();
@@ -780,6 +781,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateResAuditVendor(VerificationDTO verificationDTO){
         String kind = verificationDTO.getVc_kind();
+        kind = transferKind(kind);
         if(kind.equals("prepaid_offset_payable")){
             Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
             Double preamount = vendorData.getVe_preamount()==null?new Double(0):vendorData.getVe_preamount();

+ 15 - 0
applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml

@@ -20,6 +20,12 @@
     <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
     <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
   </resultMap>
+
+  <resultMap id="BaseAddMap" type="com.usoftchina.saas.money.po.VendorAdd" >
+    <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
+    <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
+    <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+  </resultMap>
   <sql id="Base_Column_List" >
     sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount, 
     sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount, 
@@ -247,4 +253,13 @@
         where sl_code = #{sl_code,jdbcType=VARCHAR}
     </select>
 
+  <select id="selectAdd" resultMap="BaseAddMap">
+    select a.sl_orderamount as beginamount, b.sl_orderamount as nowamount, c.sl_orderamount as nowpay FROM
+(select sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '期初余额') a
+left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '采购验收单' or sl_kind = '采购验退单'
+group by sl_vendid,sl_ym) b on a.sl_vendid=b.sl_vendid
+left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '付款单' or sl_kind = '其他支出单'
+group by sl_vendid,sl_ym) c on a.sl_vendid=c.sl_vendid
+ where a.sl_vendid=#{sl_vendid,jdbcType=INTEGER} and a.sl_ym=#{sl_ym, jdbcType=INTEGER}
+  </select>
 </mapper>

+ 55 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java

@@ -493,4 +493,59 @@ public class DateUtils {
         return true;
     }
 
+    /**
+     * String转Date类型
+     *
+     * @param dateStr
+     *            时间字符串
+     * @return Date类型时间
+     * @throws Exception
+     *             异常
+     */
+    public static Date string2Date(String dateStr, String format) throws Exception {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (dateStr != null) {
+            return sdf.parse(dateStr);
+        }else {
+            return null;
+        }
+    }
+
+    /**
+     * Date转String
+     *
+     * @param date
+     *            Date类型时间
+     * @return 时间字符串
+     */
+    public static String date2String(Date date, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (date != null) {
+            return sdf.format(date);
+        }else {
+            return null;
+        }
+    }
+
+    //取月份第一天
+    public static Date getFirstDay(Date date){
+        String dates = date2String(date, "yyyy-MM");
+        dates = dates + "-01";
+        Date d = null;
+        try {
+            d = string2Date(dates, "yyyy-MM-dd");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return d;
+    }
+
+    //获取期间
+    public static int getYm(Date date){
+        String dates = date2String(date, "yyyyMM");
+//        dates = dates + "01";
+        int d = Integer.parseInt(dates);
+        return d;
+    }
+
 }

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

@@ -183,7 +183,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                     grid.saveDocumentAs({
                         type: 'xlsx',
                         title: grid.ownerCt._title + '列表',
-                        fileName: grid.ownerCt._title + '列表.xlsx'
+                        fileName: grid.ownerCt._title + '列表'+Ext.Date.format(new Date(),'Y-m-d_H-i-s')+'.xlsx'
                     });
                     grid.store.exportPageSize = null;
                     grid.store.exportNumber = null;

+ 2 - 1
frontend/saas-web/app/view/core/form/DataMultiCombo.js

@@ -72,11 +72,12 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
         if (!me.menu) {
 
             me.menu = Ext.create('Ext.menu.Menu',{
+                style:'max-height: 195px;overflow-y:scroll;',
                 hideOnParentHide: false,
                 items: me.getMenuItems(),
                 listeners:{
                     mouseleave:me.onMouseLeave,
-                    scope:me
+                    scope:me,
                 }
             });
         }

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

@@ -338,7 +338,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     grid.saveDocumentAs({
                         type: 'xlsx',
                         title: grid.addTitle + '列表',
-                        fileName: grid.addTitle + '列表.xlsx'
+                        fileName: grid.addTitle + '列表'+ Ext.Date.format(new Date(),'Y-m-d_H-i-s') +'.xlsx'
                     });
                     grid.store.exportPageSize = null;
                     grid.store.exportNumber = null;

+ 1 - 1
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -30,7 +30,7 @@ Ext.define('saas.view.core.report.ReportPanelController', {
                 }
                 //font:
             },
-            fileName: title + '.' + (btn.cfg.ext || btn.cfg.type)
+            fileName: title + Ext.Date.format(new Date(),'Y-m-d_H-i-s') +'.' + (btn.cfg.ext || btn.cfg.type)
         }, btn.cfg);
         grid.store.exportPageSize = 5000;
         grid.store.exportNumber = 1;

+ 57 - 2
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -247,7 +247,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             },{
                 xtype:'textfield',
-                fieldLabel: '联系电话',
+                fieldLabel: '手机号码',
                 name: 'mobile',
                 readOnly:true,
                 editable:false,
@@ -256,7 +256,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             },{
                 xtype:'textfield',
-                fieldLabel: '联系邮件',
+                fieldLabel: '邮箱',
                 name: 'email',
                 readOnly:true,
                 editable:false,
@@ -265,6 +265,61 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             }]
         },
+        accountadd:{
+            items:[{
+                xtype:'textfield',
+                fieldLabel: '手机号码',
+                name: 'mobile',
+                hideTrigger:true,
+                allowBlank:false,
+                maxLength: 30,
+                regex:/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/,
+                regexText:'请输入正确的手机号码',
+                listeners:{
+                    blur:function(f,a,b,c){
+                        if(f.value&&f.value!=''&&f.isValid()){
+                            // var url = 'https://sso.ubtob.com' + '/api/user/checkMobile?mobile='+f.value;
+                            // saas.util.BaseUtil.request({url })
+                            // .then(function(res) {
+                            //     if(res.success) {
+                            //     }
+                            // })
+                            // .catch(function(response) {
+                            // });
+                            // Ext.Ajax.request({
+                            //     url: Ext.manifest.server.accountPath + '/api/user/checkMobile',
+                            //     params: {
+                            //         mobile: f.value
+                            //     },
+                            //     method: 'GET',
+                            //     headers:{
+                            //         'Access-Control-Allow-Origin': '*',
+                            //         "Content-Type": 'application/json;charset=UTF-8'
+                            //     },
+                            //     success: function (response) {
+                            //         debugger
+                            //     },
+                            //     failure: function (response) {
+                            //         debugger
+                            //     }
+                            // });
+                        }
+                    }
+                }
+            },{
+                xtype:'textfield',
+                fieldLabel: '真实姓名',
+                name: 'realname',
+                allowBlank:false,
+                maxLength: 30,
+            },{
+                xtype:'textfield',
+                fieldLabel: '邮箱',
+                name: 'email',
+                allowBlank:false,
+                maxLength: 30,
+            }]
+        },
         warehouse:{
             items:[{
                 xtype:'hidden',

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

@@ -258,6 +258,16 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             reqUrl:'/api/account/account/bind/roles',
         },
+        accountadd:{
+            columns:[{
+                dataIndex:'realname',
+            },{
+                dataIndex: 'mobile',
+            },{
+                dataIndex: 'email',
+            }],
+            reqUrl: 'http://192.168.253.31:8560/api/account/account/register/add',
+        },
         employee:{
             columns: [{
                 text: '人员编号',

+ 233 - 20
frontend/saas-web/app/view/money/report/AccountDetails.js

@@ -1,37 +1,67 @@
 Ext.define('saas.view.money.report.AccountDetails', {
-    extend: 'saas.view.core.report.ReportPanel',
+    extend: 'Ext.grid.Panel',
     xtype: 'monry-report-accountdetails',
 
     controller: 'money-report-accountdetails',
     viewModel: 'money-report-accountdetails',
 
     viewName: 'money-report-accountdetails',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
 
     // groupField: null,
-    listUrl: '/api/money/report/accountdetails',
+    dataUrl: '/api/money/report/accountdetails',
     defaultCondition: null,
     reportTitle: '核销对账表',
     QueryWidth:0.25,
     //筛选:客户/供应商、日期、单据类型(必填)
-    searchItems: [ {
-        xtype: 'vendorDbfindTrigger',
-        name: 've_name',
-        fieldLabel: '供应商名称',
-        columnWidth: 0.25,
-        // allowBlank:false
-    }, {
-        xtype: 'customerDbfindTrigger',
-        name: 'cu_name',
-        fieldLabel: '用户名称',
-        columnWidth: 0.25,
-        // allowBlank:false
+    tbar: [{
+        width: 150,
+        name: 'sl_kind',
+        xtype: 'textfield',
+        emptyText : '单据类型'
     },{
-        xtype: 'condatefield',
+        width: 400,
         name: 'date',
-        fieldLabel: '单据日期',
-        columnWidth: 0.5
-    }],
-    reportColumns: [
+        xtype: 'condatefield',
+        emptyText : '单据日期'
+    },{
+        width: 200,
+        name: 've_name',
+        xtype: 'textfield',
+        emptyText : '供应商名称'
+    },{
+            width: 200,
+            name: 'cu_name',
+            xtype: 'textfield',
+            emptyText : '客户名称'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+    columns: [
         {
             text: 'id',
             dataIndex: 'pi_id',
@@ -97,5 +127,188 @@ Ext.define('saas.view.money.report.AccountDetails', {
             //     var format = '0,000.' + xr.join();
             //     return Ext.util.Format.number(v, format);
             // }
-        }]
+        }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list.list',
+                        totalProperty: 'data.list.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+            items = me.selModel.getSelection(),
+            data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+        return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+            conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+                func = item.getCondition,
+                value = item.value,
+                condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                    type = item.fieldType || me.getDefaultFieldType(xtype),
+                    operation = item.operation || me.getDefaultFieldOperation(xtype),
+                    conditionValue = me.getConditionValue(xtype, value);
+
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
 });

+ 27 - 21
frontend/saas-web/app/view/money/report/AccountDetailsController.js

@@ -1,28 +1,34 @@
 Ext.define('saas.view.money.report.AccountDetailsController', {
-    extend: 'saas.view.core.report.ReportPanelController',
+    extend: 'saas.view.core.base.BasePanelController',
     alias: 'controller.money-report-accountdetails',
+    // init: function (form) {
+    //     this.control({
+    //         // 供应商编号
+    //         'dbfindtrigger[name=ve_name]':{
+    //             beforerender:function(f){
+    //                 Ext.apply(f,{
+    //                     dbfinds:[{
+    //                         from:'ve_name',to:'ve_name'
+    //                     }],
+    //                 }) ;
+    //             }
+    //         },
+    //         // 客户编号
+    //         'dbfindtrigger[name=cu_name]':{
+    //             beforerender:function(f){
+    //                 Ext.apply(f,{
+    //                     dbfinds:[{
+    //                         from:'cu_name',to:'cu_name'
+    //                     }],
+    //                 }) ;
+    //             }
+    //         }
+    //     });
+    // }
+
     init: function (form) {
+        var me = this;
         this.control({
-            // 供应商编号
-            'dbfindtrigger[name=ve_name]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'ve_name',to:'ve_name'
-                        }],
-                    }) ;
-                }
-            },
-            // 客户编号
-            'dbfindtrigger[name=cu_name]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cu_name',to:'cu_name'
-                        }],
-                    }) ;
-                }
-            }
         });
     }
 });

+ 1 - 1
frontend/saas-web/app/view/money/report/AccountDetailsMode.js

@@ -1,4 +1,4 @@
 Ext.define('saas.view.money.report.AccountDetailsModel', {
-    extend: 'saas.view.core.report.ReportPanelModel',
+    extend: 'saas.view.core.base.BasePanelModel',
     alias: 'viewmodel.money-report-accountdetails'
 });

+ 16 - 4
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -46,7 +46,18 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 ['receivable_offset_payable', '应收冲应付'],
                 ['receivable_to_receivable', '应收转应收'],
                 ['payable_to_payable', '应付转应付']
-            ]
+            ],
+            listeners:{
+                beforerender:function(f){
+                    f.firstLoad=true;
+                },
+                change:function(f){
+                    if(f.bindError){
+                        f.setValue(f.defaultValue);
+                        f.bindError = false
+                    }
+                }
+            }
         }],
 
         detail1: {
@@ -268,14 +279,13 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 }
             }, {
                 text: "本次核销金额",
-                xtype: 'numbercolumn',
                 dataIndex: "vcd_nowbalance",
-                width:150,
+                xtype: 'numbercolumn',
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 2
                 },
-                allowBlank : false,
+                width: 110,
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -304,6 +314,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 xtype: 'hidden',
                 fieldLabel: '客户名称',
                 name: 'vc_custid',
+                allowBlank : false,
                 listeners: {
                     change: 'clearDetails'
                 }
@@ -339,6 +350,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 xtype: 'hidden',
                 name: 'vc_vendid',
                 fieldLabel: '供应商名称',
+                allowBlank : false,
                 listeners: {
                     change: 'clearDetails'
                 }

+ 14 - 3
frontend/saas-web/app/view/money/verification/FormPanelModel.js

@@ -7,10 +7,21 @@ Ext.define('saas.view.money.verification.FormPanelModel', {
             bind: '{vc_kind}',
             get: function(v) {
                 var form = this.getView();
+                var vc_kind = form.down('[name=vc_kind]');
                 form.acitveType = v;
-                //form.initFormItems();
-
-                return v;
+                if(form.initId==0||!vc_kind.firstLoad){
+                    form.initFormItems();
+                }
+                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;
+                }
+                
             }
         }
     }

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

@@ -20,7 +20,7 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         columnWidth: 0.2
     }, {
         xtype: 'productDbfindTrigger',
-        name: 'pr_code',
+        name: 'pr_detail',
         fieldLabel: '物料',
         columnWidth: 0.2
     }, {

+ 2 - 5
frontend/saas-web/app/view/sale/report/SaleProfitController.js

@@ -21,13 +21,10 @@ Ext.define('saas.view.sale.report.SaleProfitController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pr_code]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dbfinds:[
-                        {
-                            from:'pr_code',to:'pr_code'
-                        }, {
+                        dbfinds:[{
                             from:'pr_detail',to:'pr_detail'
                         }, {
                             from:'pr_spec',to:'pr_spec'

+ 2 - 3
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -90,12 +90,11 @@ Ext.define('saas.view.stock.stockamount.DataList', {
     {
         text : "数量",
         xtype: 'numbercolumn',
-        align: 'end',
         dataIndex : "rc_number", 
         width : 110.0, 
         renderer : function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
@@ -117,7 +116,7 @@ Ext.define('saas.view.stock.stockamount.DataList', {
         text : "金额", 
         xtype: 'numbercolumn',
         dataIndex : "rc_amount", 
-        flex : 1.0, 
+        width : 110.0,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');

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

@@ -42,7 +42,19 @@ Ext.define('saas.view.sys.account.DataList', {
                 grid.store.loadPage(1);
             }
         }
-    },'->'],
+    },'->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
 
     columns : [{
         text : 'id', 
@@ -84,7 +96,45 @@ Ext.define('saas.view.sys.account.DataList', {
     },{
         text : '关联角色', 
         dataIndex : 'roleNames', 
-        width : 110.0
+        width : 220.0
+    },{
+        text: '账户状态',
+        dataIndex: 'em_class',
+        width:90,
+        xtype: 'actioncolumn',
+        align : 'center',
+        items: [{
+            iconCls:'',
+            getClass: function(v, meta, rec) {
+                if(rec.get('em_class')=='正式'){
+                    return 'x-grid-checkcolumn-checked-btn';
+                }else{
+                    return 'x-grid-checkcolumn-btn';
+                }
+            },
+            handler: function(view, rowIndex, colIndex) {
+                var rec = view.getStore().getAt(rowIndex);
+                var type=rec.get('em_class')=='正式'?true:false;
+                //  禁用/启用
+                var form = this.ownerCt.ownerCt.ownerCt;
+                var grid = this.ownerCt.ownerCt;
+                saas.util.BaseUtil.request({
+                    url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                    params: '',
+                    method: 'POST',
+                })
+                .then(function(localJson) {
+                    if(localJson.success){
+                        saas.util.BaseUtil.showSuccessToast('操作成功');
+                        grid.store.load();
+                    }
+                })
+                .catch(function(res) {
+                    console.error(res);
+                    saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                });
+            }
+        }]
     }],
 
     dbSearchFields: [],

+ 22 - 1
frontend/saas-web/app/view/sys/account/DataListController.js

@@ -6,5 +6,26 @@ Ext.define('saas.view.sys.account.DataListController', {
         var me = this;
         this.control({
         });
-    }
+    },
+
+    onAdd:function(b){
+        var document = Ext.create('saas.view.document.kind.Kind',{});
+        var form = this.view;
+        this.dialog = form.add({
+            xtype: 'document-kind-childwin',
+            bind: {
+                title: '新增账户资料'
+            },
+            dataKind:'accountadd',
+            belong:document.etc['accountadd'],
+            _parent:form,
+            record:null,
+            session: true
+        });
+        this.dialog.show();
+    },
+    onRefresh:function(){
+        var me = this;
+        me.view.items.items[0].store.load();
+    },
 });

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

@@ -159,11 +159,6 @@
             "text": "资金转存",
             "addType": "money-fundtransfer-formpanel",
             "viewType": "money-fundtransfer-querypanel"
-        }, {
-            "id": "verification",
-            "text": "核销单",
-            "addType": "money-verification-formpanel",
-            "viewType": "money-verification-querypanel"
         }]
     }, {
         "text": "报表",