chenw 7 年 前
親
コミット
21e74e28b6
37 ファイル変更、691 行追加、122 行削除
  1. 3 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  2. 1 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  3. 31 0
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java
  4. 2 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  5. 2 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  6. 2 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  7. 2 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  8. 17 9
      applications/money/money-server/src/main/resources/mapper/StatsinfoMapper.xml
  9. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java
  10. 2 0
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml
  11. 1 1
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/RoleResourceMapper.java
  12. 7 1
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/RoleServiceImpl.java
  13. 8 3
      base-servers/account/account-server/src/main/resources/mapper/RoleResourceMapper.xml
  14. 20 1
      base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java
  15. 7 1
      base-servers/file/file-server/src/main/resources/application.yml
  16. 6 1
      framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java
  17. 27 0
      frontend/saas-web/app/Application.scss
  18. 14 2
      frontend/saas-web/app/util/FormUtil.js
  19. 3 0
      frontend/saas-web/app/view/core/base/GridPanel.js
  20. 228 0
      frontend/saas-web/app/view/core/form/field/FileField.js
  21. 120 0
      frontend/saas-web/app/view/core/form/field/TrashField.js
  22. 4 7
      frontend/saas-web/app/view/document/customer/BasePanel.js
  23. 0 13
      frontend/saas-web/app/view/document/customer/FormPanel.js
  24. 4 7
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  25. 0 14
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  26. 0 1
      frontend/saas-web/app/view/main/MainController.js
  27. 34 19
      frontend/saas-web/app/view/money/verification/FormPanel.js
  28. 3 1
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  29. 115 10
      frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js
  30. 5 5
      frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js
  31. 5 4
      frontend/saas-web/app/view/sale/b2b/Product.js
  32. 2 0
      frontend/saas-web/app/view/sale/b2b/recformpanel/FormPanelController.js
  33. 4 3
      frontend/saas-web/app/view/sale/b2b/reconciliation/DataList.js
  34. 8 0
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  35. 2 2
      frontend/saas-web/app/view/sys/config/FormPanel.js
  36. BIN
      frontend/saas-web/resources/images/default/delete.png
  37. BIN
      frontend/saas-web/resources/images/default/download.png

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

@@ -353,7 +353,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         map.put("custuu", companyDTO.getUu());
         map.put("apcheck", 1);
         Map<String, String> params = new HashMap<String, String>();
-        params.put("data", JsonUtils.toJsonString(map));
+        List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
+        data.add(map);
+        params.put("data", JsonUtils.toJsonString(data));
         Response response = HttpUtil.sendPostRequest(b2bUrl + "/erp/vendor/apcheck?access_id=" + companyDTO.getUu(), params, true, companyDTO.getAccessKey());
         if (response.getStatusCode() == 200){
             LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -100,7 +100,7 @@
         pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
         pr_vendid, pr_vendcode, pr_vendname, pr_status,
         pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
-        pr_text4, pr_text5,pr_remark
+        pr_text4, pr_text5,pr_remark,b2bStatus
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
         select

+ 31 - 0
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java

@@ -2,16 +2,25 @@ package com.usoftchina.saas.document.service;
 
 
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.account.dto.CompanyDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.DocumentApplication;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.utils.JsonUtils;
+import com.usoftchina.saas.utils.http.HttpUtil;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = DocumentApplication.class)
@@ -21,6 +30,8 @@ public class VendorTest {
     @Autowired
     private VendorService vendorService;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(VendorTest.class);
+
     @Test
     public void testSelectAll(){
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
@@ -29,4 +40,24 @@ public class VendorTest {
         System.out.println("vendType: " + vendorList.getList().get(0).getVe_type());
         System.out.println("vendBeginDate: " + vendorList.getList().get(0).getVe_status());
     }
+
+    @Test
+    public void enableApCheck() throws Exception {
+        Map<String, Object> map = new HashMap<String, Object>();
+        String ve_uu = "10050735";
+        map.put("venduu", ve_uu);
+        map.put("custuu", 10050742);
+        map.put("apcheck", 1);
+        Map<String, String> params = new HashMap<String, String>();
+        List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
+        data.add(map);
+        params.put("data", JsonUtils.toJsonString(data));
+        HttpUtil.Response response = HttpUtil.sendPostRequest("http://test-b2b.uuzcc.cn" + "/erp/vendor/apcheck?access_id=" + 10050735, params, true, "94be4fe301c64a728a4bbf37bd348eab");
+        if (response.getStatusCode() == 200){
+            LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);
+        }else {
+            LOGGER.info("供应商UU={},启用B2B对账失败!,原因={}", ve_uu, response.getResponseText());
+        }
+    }
+
 }

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

@@ -188,8 +188,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = othreceiptsdetailMapper.selectYm(Math.toIntExact(id));
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(companyId);
         Integer yms = statsinfoMapper.select(ym, companyId);
         statsinfo.setSi_yearmonth(Double.valueOf(ym));
@@ -275,7 +274,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = othreceiptsdetailMapper.selectYm(id);
-        Integer ym = ymList.indexOf(0);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));

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

@@ -227,8 +227,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = othspendingsdetailMapper.selectYm(Math.toIntExact(id));
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));
@@ -309,8 +308,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = othspendingsdetailMapper.selectYm(id);
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));

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

@@ -266,8 +266,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = paybalancedetMapper.selectYm(Math.toIntExact(id));
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));
@@ -395,8 +394,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = paybalancedetMapper.selectYm(id);
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));

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

@@ -312,8 +312,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = recbalancedetMapper.selectYm(Math.toIntExact(id));
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));
@@ -442,8 +441,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = recbalancedetMapper.selectYm(Math.toIntExact(id));
-        Integer ym = ymList.indexOf(0);
-        System.out.println("ym:"+ym);
+        Integer ym = ymList.get(0);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
         Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
         statsinfo.setSi_yearmonth(Double.valueOf(ym));

+ 17 - 9
applications/money/money-server/src/main/resources/mapper/StatsinfoMapper.xml

@@ -39,22 +39,26 @@
                 #{si_yearmonth,jdbcType=INTEGER},
             </if>
             <if test="si_amount_pay != null" >
-                (select sum(pd_amount) from paybalancedet left join paybalance on pd_pbid=pb_id
+                (select  sum(IFNULL(pd_amount,0)*(case when ifnull(pd_rate,0)=0 then 1 else pd_rate end))
+                 from paybalancedet left join paybalance on pd_pbid=pb_id
                 where paybalance.companyId= #{companyid,jdbcType=INTEGER}
                 and pd_ym=#{si_yearmonth,jdbcType=INTEGER} and pb_statuscode='AUDITED'),
             </if>
             <if test="si_amount_otherpay != null" >
-                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
+                (select sum(IFNULL(os_amount,0)*(case when ifnull(os_rate,0)=0 then 1 else os_rate end))
+                from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
                 where othspendingsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and osd_ym=#{si_yearmonth,jdbcType=INTEGER} and os_statuscode='AUDITED'),
             </if>
             <if test="si_amount_rec != null" >
-                (select sum(rd_amount) from recbalancedet left join recbalance on rd_rbid=rb_id
+                (select sum(IFNULL(rd_amount,0)*(case when ifnull(rd_rate,0)=0 then 1 else rd_rate end))
+                 from recbalancedet left join recbalance on rd_rbid=rb_id
                 where recbalancedet.companyId=#{companyid,jdbcType=INTEGER}
                 and rd_ym=#{si_yearmonth,jdbcType=INTEGER} and rb_statuscode='AUDITED'),
             </if>
             <if test="si_amount_otherrec != null" >
-                (select  sum(or_amount) from othreceipts RIGHT JOIN othreceiptsdetail on or_id = ord_orid
+                (select  sum(IFNULL(or_amount,0)*(case when ifnull(or_rate,0)=0 then 1 else or_rate end))
+                 from othreceipts RIGHT JOIN othreceiptsdetail on or_id = ord_orid
                 where othreceiptsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and ord_ym=#{si_yearmonth,jdbcType=INTEGER} and or_statuscode='AUDITED'),
             </if>
@@ -70,25 +74,29 @@
         <set >
             <if test="si_amount_pay != null" >
                 si_amount_pay =
-                (select sum(pd_amount) from paybalancedet left join paybalance on pd_pbid=pb_id
+                (select sum(IFNULL(pd_amount,0)*(case when ifnull(pd_rate,0)=0 then 1 else pd_rate end))
+                from paybalancedet left join paybalance on pd_pbid=pb_id
                 where paybalance.companyId= #{companyid,jdbcType=INTEGER}
                 and pd_ym=#{si_yearmonth,jdbcType=INTEGER} and pb_statuscode='AUDITED'),
             </if>
             <if test="si_amount_otherpay != null" >
                 si_amount_otherpay =
-                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
+                (select sum(IFNULL(os_amount,0)*(case when ifnull(os_rate,0)=0 then 1 else os_rate end))
+                 from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
                 where othspendingsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and osd_ym=#{si_yearmonth,jdbcType=INTEGER} and os_statuscode='AUDITED'),
             </if>
             <if test="si_amount_rec != null" >
                 si_amount_rec =
-                (select sum(rd_amount) from recbalancedet left join recbalance on rd_rbid=rb_id
+                (select sum(IFNULL(rd_amount,0)*(case when ifnull(rd_rate,0)=0 then 1 else rd_rate end))
+                 from recbalancedet left join recbalance on rd_rbid=rb_id
                 where recbalancedet.companyId=#{companyid,jdbcType=INTEGER}
                 and rd_ym=#{si_yearmonth,jdbcType=INTEGER} and rb_statuscode='AUDITED'),
             </if>
             <if test="si_amount_otherrec != null" >
                 si_amount_otherrec =
-                (select  sum(or_amount) from othreceipts RIGHT JOIN othreceiptsdetail on or_id = ord_orid
+                (select  sum(IFNULL(or_amount,0)*(case when ifnull(or_rate,0)=0 then 1 else or_rate end))
+                 from othreceipts RIGHT JOIN othreceiptsdetail on or_id = ord_orid
                 where othreceiptsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and ord_ym=#{si_yearmonth,jdbcType=INTEGER} and or_statuscode='AUDITED'),
             </if>
@@ -98,6 +106,6 @@
     </update>
 
     <select id="select" resultType="java.lang.Integer">
-        select DISTINCT si_yearmonth from statsinfo where si_yearmonth =#{si_yearmonth,jdbcType=INTEGER} and companyid = #{companyid,jdbcType=INTEGER}
+        select DISTINCT si_yearmonth from statsinfo where si_yearmonth =#{si_yearmonth,jdbcType=INTEGER} and companyid = #{companyid,jdbcType=INTEGER} and si_type='FUND'
     </select>
 </mapper>

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

@@ -34,5 +34,7 @@ public class ProdiodetailView implements Serializable{
 
     private String pr_brand;
     private String pr_orispeccode;
+    private String creatorName;
+    private String pi_auditman;
 
 }

+ 2 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml

@@ -23,6 +23,8 @@
     <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
     <result column="pr_brand" jdbcType="VARCHAR" property="pr_brand" />
     <result column="pr_orispeccode" jdbcType="VARCHAR" property="pr_orispeccode" />
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
   </resultMap>
 
 

+ 1 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/RoleResourceMapper.java

@@ -67,7 +67,7 @@ public interface RoleResourceMapper {
      * 查询所有的ClassIfy
      * @return
      */
-    List<PowerInfo> selectPowerInfo();
+    List<PowerInfo> selectPowerInfo(@Param("condition") String condition);
 
     /**
      * 查询其他权限

+ 7 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/RoleServiceImpl.java

@@ -7,6 +7,7 @@ import com.usoftchina.saas.account.po.*;
 import com.usoftchina.saas.account.service.ResourceService;
 import com.usoftchina.saas.account.service.RoleService;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.cache.ConfigsCache;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
@@ -92,7 +93,12 @@ public class RoleServiceImpl extends CommonBaseServiceImpl<RoleMapper, Role> imp
     public List<PowerDTO> getResourcePowerById(Long id) {
         List<PowerDTO> powerDTOList = new ArrayList<PowerDTO>();
         List<Map<String, Object>> classifyList = roleResourceMapper.selectClassifyByRoleId(id);
-        List<PowerInfo> powerInfoList = roleResourceMapper.selectPowerInfo();
+        boolean enableB2B = ConfigsCache.current().enableB2B();
+        String condition = null;
+        if (!enableB2B){
+            condition = "s.is_b2b = 0";
+        }
+        List<PowerInfo> powerInfoList = roleResourceMapper.selectPowerInfo(condition);
         List<OtherPower> otherPowerList = roleResourceMapper.selectOthersPower();
         List<OtherPower> hasOtherPowerList = roleResourceMapper.selectOthersPowerByRoleId(id);
 

+ 8 - 3
base-servers/account/account-server/src/main/resources/mapper/RoleResourceMapper.xml

@@ -34,11 +34,16 @@
     <select id="selectPowerInfo" parameterType="java.lang.Long" resultType="com.usoftchina.saas.account.po.PowerInfo">
         SELECT GROUP_CONCAT(classify) classify,group_id groupId,groupname,moduleId,modulename FROM (
           SELECT classify,group_id,s.name groupname,M.NAME modulename,M.id moduleId FROM AC_RESOURCE R
-				LEFT JOIN AC_RESOURCE_GROUP S ON R.GROUP_ID = S.ID
-				LEFT JOIN AC_RESOURCE_MODULE M ON S.MODULE_ID = M.ID
+          LEFT JOIN AC_RESOURCE_GROUP S ON R.GROUP_ID = S.ID
+          LEFT JOIN AC_RESOURCE_MODULE M ON S.MODULE_ID = M.ID
+          <where>
+            <if test="condition != null">
+              ${condition}
+            </if>
+          </where>
           GROUP BY GROUP_ID,CLASSIFY,s.name,M.NAME,M.id) A
         GROUP BY GROUP_ID,groupname,modulename,moduleId
-		ORDER BY MODULEID
+		    ORDER BY MODULEID
     </select>
     <resultMap id="OtherPowerResultMap" type="com.usoftchina.saas.account.po.OtherPower">
         <result column="name" property="name" jdbcType="VARCHAR" />

+ 20 - 1
base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java

@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -188,7 +189,25 @@ public class FileController {
     }
 
     @ApiOperation(value = "查看文件信息")
-    @GetMapping(value = "/info")
+    @GetMapping(value = "/info", params = "ids")
+    public Result<FileInfoDTO> getFileInfoList(String ids) {
+        if (StringUtils.isEmpty(ids)){
+            throw new BizException(ExceptionCode.ILLEGAL_ARGUMENTS);
+        }
+        List<FileInfo> fileInfoList = new ArrayList<>();
+        String[] idArr = ids.split(";");
+        for (int i = 0; i < idArr.length; i++) {
+            FileInfo info = fileService.findByPrimaryKey(Long.parseLong(idArr[i]));
+            fileInfoList.add(info);
+        }
+        if (!CollectionUtils.isEmpty(fileInfoList)) {
+            return Result.success(BeanMapper.mapList(fileInfoList, FileInfoDTO.class));
+        }
+        return Result.error(ExceptionCode.FILE_NOT_EXISTS);
+    }
+
+    @ApiOperation(value = "查看文件信息")
+    @GetMapping(value = "/info", params = "path")
     public Result<FileInfoDTO> getFileInfo(@RequestParam("path") String path) {
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {

+ 7 - 1
base-servers/file/file-server/src/main/resources/application.yml

@@ -39,6 +39,12 @@ spring:
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
+  servlet:
+    multipart:
+      enabled: true
+      #20971520 ->  20M
+      max-file-size: 20971520
+      max-request-size: 20971520
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10
@@ -51,7 +57,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@10.1.81.61:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
   port: 8640
   tomcat:

+ 6 - 1
framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.cache;
 
 import org.springframework.data.redis.core.BoundHashOperations;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
 
 import java.util.Optional;
 import java.util.Set;
@@ -25,7 +27,10 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
     protected abstract F field();
 
     protected BoundHashOperations<K, F, V> getBoundHashOperations() {
-        return super.getRedisTemplate().boundHashOps(key());
+        RedisTemplate redisTemplate = super.getRedisTemplate();
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashValueSerializer(new Jackson2JsonRedisSerializer(Object.class));
+        return redisTemplate.boundHashOps(key());
     }
 
     public Set<F> keys() {

+ 27 - 0
frontend/saas-web/app/Application.scss

@@ -657,3 +657,30 @@ input::-webkit-input-placeholder {
     }
   }
 }
+
+.x-form-filefield{
+  .x-form-item-body{
+    .x-form-trigger-wrap{
+      .x-form-trigger{
+        background: #f7f7f7 !important;
+      }
+    } 
+  }
+}
+
+.x-filefield-button{
+  margin-top: 8px !important
+}
+.x-form-download-trigger {
+	background: #fff url(../resources/images/default/download.png) no-repeat center
+    center !important;
+}
+.x-form-trash-trigger {
+	background: #fff url(../resources/images/default/delete.png) no-repeat center
+    center !important;
+}
+.x-fieldset{
+  .x-form-trigger-default:before{
+    content:""
+  }
+}

+ 14 - 2
frontend/saas-web/app/util/FormUtil.js

@@ -20,7 +20,7 @@ Ext.define('saas.util.FormUtil', {
 
                     items = me.applyItemsGroup(defaultItems || []);
                     items = me.initItems(items);
-                    items = me.applyCusMainItemConfig(items, cfg);
+                    items = me.applyCusMainItemConfig(items, cfg, form);
                     items = me.applyCusDetailItemConfig(items, cfg);
 
                     form.configItems = items;
@@ -198,7 +198,7 @@ Ext.define('saas.util.FormUtil', {
         },
 
         // 将自定义配置应用到默认items
-        applyCusMainItemConfig: function(items, cfg) {
+        applyCusMainItemConfig: function(items, cfg, form) {
             let me = this,
             cusMainItems = cfg.main || [];
 
@@ -218,6 +218,11 @@ Ext.define('saas.util.FormUtil', {
                     });
                     
                 }
+                //附件名称的自定义字段 使用附件类型
+                if(item.fieldLabel == '附件' && item.name.indexOf('_text')>-1){
+                    item.xtype = 'mfilefield'
+                    form.renderMF = item.name
+                }
             });
 
             Ext.Array.sort(items, function(a, b) {
@@ -421,6 +426,13 @@ Ext.define('saas.util.FormUtil', {
                         }
                         form.initFormData(o);
                         form.fireEvent('load', form, o);
+
+                        //渲染附件
+                        if(form.renderMF&&form.down('[name='+form.renderMF+']')){
+                            let MF = form.down('[name='+form.renderMF+']')
+                            MF.value = o.main[form.renderMF]
+                            MF.renderMF(MF)
+                        }
                     }
                 })
                 .catch(function(e) {

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

@@ -87,6 +87,9 @@ Ext.define('saas.view.core.base.GridPanel', {
                                 console.error('exception: ', response);
                                 var message = response.responseJson?(response.responseJson.message==null?'没有数据':response.responseJson.message):'请求超时';
                                 saas.util.BaseUtil.showErrorToast('查询失败:' + message);
+                                if(response.responseJson.message==null){
+                                    Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].items.items[0].store.removeAll()
+                                }
                             }
                         }
                     }

+ 228 - 0
frontend/saas-web/app/view/core/form/field/FileField.js

@@ -0,0 +1,228 @@
+/**
+ * 多文件上传下载
+ */
+Ext.define('saas.view.core.form.field.FileField', {
+	extend: 'Ext.form.FieldSet',
+	alias: 'widget.mfilefield',
+	minHeight: 22,
+	collapsible: true,
+	multi: true,
+	allowBlank:true,
+	initComponent: function() {
+		this.columnWidth = 1;//强制占一行
+		this.cls = '';
+		this.title = this.title || '附件';
+		this._title = this.title;
+		this.callParent(arguments);
+	},
+	layout:'column',
+	items: [{
+		xtype: 'form',
+		columnWidth: 1,
+		frame: false,
+		border: false,
+		minHeight: 22,
+		bodyStyle: 'padding:2px;background:#f7f7f7',
+		layout: 'hbox',
+		items: [{
+			xtype: 'filefield',
+			name: 'file',
+			cls:'x-form-filefield',
+			buttonText: '浏览文件(≤20MB)',
+			buttonOnly: true,
+			hideLabel: true,
+			buttonConfig:{
+				cls:'x-filefield-button'
+			},
+			createFileInput : function() {
+	            var me = this;
+	            me.fileInputEl = me.button.el.createChild({
+	            name: me.getName(),
+	            cls: Ext.baseCSSPrefix + 'form-file-input',
+	            tag: 'input',
+	            type: 'file',
+	            multiple:'multiple',
+	            size: 1
+	           }).on('change', me.onFileChange, me);
+	        },
+			listeners: {
+				change: function(field){
+					if(field.value != null){
+						field.ownerCt.ownerCt.upload(field.ownerCt, field);
+					}
+				}
+			}
+		}]
+	}],
+	setValue: function(value){
+		this.value = value;
+		this.dirty = true;
+		this.ownerCt.viewModel.data[this.name] = this.value
+	},
+	getValue: function (){
+		return this.down('hidden').value;
+	},
+	renderMF: function(f){
+		f.setHtml(null);
+		var form = f.ownerCt;			
+		if(f.value != null && f.value.toString().trim() != ''){
+			f.download(f.value,f.name);
+		}
+		if(typeof(form.readOnly)!="undefined"){
+			f.setReadOnly(form.readOnly);
+		}
+	},
+	/**
+	 * 上传附件
+	 */
+	upload: function(form, field){
+		var me = this;
+		var myForm = field.ownerCt;
+		var fileEl = field.fileInputEl.dom;
+		var fd = new FormData();
+		fd.append('file', fileEl.files[0]);
+		fd.append('folderId', 0);
+		form.setLoading(true);
+		Ext.Ajax.request({
+			url: '/api/file/upload',//这里是填写需要跨域访问的URL
+			cors: true,
+			useDefaultXhrHeader: false,
+			method: 'post',
+			rawData: fd,
+			headers: {
+				'Access-Control-Allow-Origin': '*',
+				'Authorization':  saas.util.State.get('session').token,
+				//"Content-Type": 'multipart/form-data'  //文件上传的格式, 
+				"Content-Type":null
+			},
+			success: function (response, opts) {
+				form.setLoading(false);
+				var res = Ext.decode(response.responseText);
+				if(res.success){
+					saas.util.BaseUtil.showSuccessToast('上传成功');
+					var data = res.data;
+					var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
+					var w = Math.min((me.getStrLength(name) + 25) / 200, .8);
+					if(data.id){
+						field = Ext.create('saas.view.core.form.field.TrashField', {
+							fileName: data.name,
+							value: name,
+							columnWidth: w,
+							readOnly: false,
+							editable: false,
+							filepath: data.fullPath,
+							filesize: data.size,
+							_id:data.id,
+							fieldStyle: 'background:#E0EEEE;'
+						});
+						me.add(field);
+						val = (me.value || '') + data.id + ';';
+						// //添加FilePath表的ID
+						me.setValue(val);
+					}
+				}else{
+					saas.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
+				}
+			},
+			failure: function (response, opts) {
+				form.setLoading(false);
+				var res = Ext.decode(response.responseText);
+				saas.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
+			}
+		});
+	},
+	/**
+	 * 根据id读取对应PATH
+	 * @param id{String} fp_id
+	 */
+	download: function(id,name){
+		var me = this;
+		me.clearAll();
+		var files = new Array();	
+		Ext.Ajax.request({
+			url : '/api/file/info',
+			async: false,
+			params: {
+				ids:  id
+			},
+			method : 'GET',
+			callback : function(options,success,response){
+				var res = new Ext.decode(response.responseText);
+				if(res.exception || res.exceptionInfo){
+					showError(res.exceptionInfo);
+					return;
+				}
+				files = res.data != null ? res.data : [];
+			}
+		});		
+		Ext.each(files, function(f){
+			var name = f.name + "  (" + Ext.util.Format.fileSize(f.size) + ")";
+			var w = Math.min((me.getStrLength(name) + 25) / 200, .8);
+			me.addItem(Ext.create('saas.view.core.form.field.TrashField', {
+				fileName: f.name,
+				value: name,
+				columnWidth: w,
+				readOnly: false,
+				editable: false,
+				filepath: f.fullPath,
+				filesize: f.size,
+				_id:f.id,
+				fieldStyle: 'background:#E0EEEE;'
+			}));
+		});
+	},
+	
+	checkUploadAmount:function(form){
+		var files = form.getEl().down('input[type=file]').dom.files;
+		var amounts = 0;
+		for (var i = 0; i < files.length; i++) {
+			amounts = amounts + files[i].size
+		}
+		if (amounts>104857600) {
+			Ext.MessageBox.alert("警告","对不起,上传文件总大小超过100m");
+			return false
+		}
+		return true;
+	},
+	addItem: function(item){
+		this.add(item);
+	},
+	setReadOnly: function(bool){
+		//只读情况下限制不允许上传
+		var f=this.down('filefield');
+		if(f.button&&f.fileInputEl){
+			//若界面配置字段可修改则允许传附件 
+			if(this.modify) bool=false;
+			f.button.setDisabled(bool);
+			if(bool) {
+				f.fileInputEl.dom.setAttribute('disabled',bool);	
+			}else f.fileInputEl.dom.removeAttribute('disabled');			
+		}
+	},
+	setFieldStyle: function(str) {
+
+	},
+	getStrLength: function(str) {
+		for (var len = str.length, c = 0, i = 0; i < len; i++) 
+        	str.charCodeAt(i) < 27 || str.charCodeAt(i) > 126 ? c += 2 : c++;
+        return c;
+	},
+	clearAll: function() {
+		var me = this, items = me.query('trashfield');
+		Ext.Array.each(items, function(item){
+			me.remove(item);
+		});
+		me.filesize = 0;
+	},
+	checkFile:function(fileName){
+		var arr=['php','php2','php3', 'php5', 'phtml', 'asp', 'aspx', 'ascx', 'jsp', 'cfm', 'cfc', 'pl','pl','bat',  'dll', 'reg', 'cgi','war'];
+	    var suffix=fileName.substring(fileName.lastIndexOf(".")+1);
+	    return Ext.Array.contains(arr,suffix);
+	},
+	isValid:function(){
+		return true;
+	},
+	isDirty:function(){
+		return this.dirty;
+	}
+});

+ 120 - 0
frontend/saas-web/app/view/core/form/field/TrashField.js

@@ -0,0 +1,120 @@
+/**
+ * 显示附件名称、大小;
+ * 附件删除、下载、显示
+ */
+Ext.define('saas.view.core.form.field.TrashField', {
+	extend : 'Ext.form.field.Trigger',
+	alias : 'widget.trashfield',
+	trigger1Cls: 'x-form-download-trigger',
+    trigger2Cls: 'x-form-trash-trigger',
+    style:'margin:5px 0 0 0',
+	fieldStyle: 'background:#C6E2FF;color:#D9D9D9;',
+    autoShow: true,
+	initComponent : function() {
+		this.callParent(arguments);
+	},
+	listeners : {
+		afterrender : function() {
+			var me = this, c = Ext.Function.bind(me.onTrigger1Click, me);
+			Ext.EventManager.on(me.inputEl, {
+				click : c,
+				scope : me,
+				buffer : 100
+			});
+			Ext.DomHelper.applyStyles(me.inputEl.dom, 'border:none;');
+			//取消延时影藏trigger的写法 
+		/*	// 只读时,隐藏删除trigger
+			Ext.defer(function(){
+				var form = me.up('form');
+				if(me.ownerCt.readOnly) {
+					me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'hidden'});
+				}
+			}, 200);*/
+		}
+	},
+	onTrigger1Click: function(e){
+        this.download();
+	},
+	onTrigger2Click: function(){
+		var me = this;
+		saas.util.BaseUtil.warnMsg('确定删除' + me.value, function(btn){
+			if(btn == 'yes'){
+                var v = me.ownerCt.value.replace(me._id+';','')
+                me.ownerCt.setValue(v);
+                me.ownerCt.remove(me)
+				// var v = me.ownerCt.down('hidden').value.replace(me.filepath + ';', '');
+				// me.updateAttachField(v, '删除附件', function(){
+				// 	me.ownerCt.down('hidden').setValue(v);
+				// 	me.ownerCt.filesize -= me.filesize;
+				// 	me.ownerCt.setTitle('<img src="' + basePath + 'resource/images/icon/clip.png" width=20 height=20/>附件' + 
+				// 			'(总大小:' + Ext.util.Format.fileSize(me.ownerCt.filesize) + ")");
+				// });
+			}
+		});
+	},
+	download : function() {
+        var me = this;
+        var serverOptions = Ext.manifest.server;
+		window.location.href = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/file/download?path='+me.filepath;
+	},
+	showAttach : function() {
+		var me = this,src = basePath + 'common/download.action?path=' + me.realpath.replace(/\+/g, '%2B')+"&size="+me.filesize+"&fileName="+me.fileName;
+		var img = document.createElement("img");
+		img.src = src;		 		
+		myWindow=window.open(); 
+		myWindow.document.body.appendChild(img);
+		myWindow.focus();
+	},
+	isImage : function(path) {
+		if (Ext.isEmpty(path)) {
+			return false;
+		}
+		if (!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(path)) {
+			return false;
+		}
+		return true;
+	},
+	resetField:function(bool){		
+	    var me=this;
+		if(bool)
+		me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'hidden'});
+		else{
+			 me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'visible'});
+		}
+	},
+	updateAttachField: function(value, type, fn) {
+		var form = this.ownerCt.ownerCt;
+		if(form.keyField){
+			var field = this.ownerCt.name,me = this, val = Ext.getCmp(form.keyField).value;
+			if(!Ext.isEmpty(val)&&!(caller.indexOf("$")!=-1 && form.keyField=="cl_id")) {//通用变更单上的附件字段,删除附件时后台不删除
+				Ext.Ajax.request({
+					url: basePath + 'common/attach/update.action',
+					params: {
+						caller: caller,
+						table: form.tablename.toUpperCase().split("LEFT")[0],
+						update: field + '=\'' + value + '\'',
+						condition: form.keyField + "='" + val+"'",
+						type: type
+					},
+					callback: function(opt, s, r) {
+						var res = Ext.decode(r.responseText);
+						if(res.success) {
+							if(fn) {
+								fn.call();
+								me.destroy();
+							}
+						} else {
+							showError(res.exceptionInfo);
+						}
+					}
+				});
+			} else {
+				fn && fn.call();
+				this.destroy();
+			}
+		} else{
+				fn && fn.call();
+				this.destroy();
+		}
+	}
+});

+ 4 - 7
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -120,13 +120,10 @@ Ext.define('saas.view.document.customer.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: '应收余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 'cu_leftamount',
-                    width: 120,
-                    renderer : function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 'cu_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                     text : "业务员", 
                     dataIndex : "cu_sellername",

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

@@ -176,19 +176,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            }, {
-                xtype: 'textfield',
-                name: "cu_leftamount",
-                fieldLabel: "应收余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
                 xtype: "numberfield",
                 hideTrigger: true,

+ 4 - 7
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -111,13 +111,10 @@ Ext.define('saas.view.document.vendor.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: '应付余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 've_leftamount',
-                    width: 120,
-                    renderer: function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 've_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                     text: "备注",
                     dataIndex: "ve_remark",

+ 0 - 14
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -183,20 +183,6 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            }, {
-                xtype: "numberfield",
-                name: "ve_leftamount",
-                fieldLabel: "应付余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                ignore: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
                 xtype: "numberfield",
                 hideTrigger: true,

+ 0 - 1
frontend/saas-web/app/view/main/MainController.js

@@ -66,7 +66,6 @@ Ext.define('saas.view.main.MainController', {
         mainLogo.animate({dynamic: true, duration: 500, to: {width: new_width}});
         Ext.fly(logoImg).animate({dynamic: true, duration: 500, to: newLogoImgStyle});
         Ext.fly(logoText).animate({dynamic: true, duration: 500, keyframes: newLogoTextStyle});
-        navigationList.body.animate({dynamic: true, duration: 500, to: {width: new_width}});
         navigationList.animate({dynamic: true, duration: 500, to: {width: new_width}});
 
         for(var i = 0; i < navItems.length; i++) {

+ 34 - 19
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -927,38 +927,53 @@ Ext.define('saas.view.money.verification.FormPanel', {
 
                 defaultConditions: {
                     receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'收款单\') or ' +
+                              '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                                            'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
                         'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or '+
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'付款单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
 
                         'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        ' and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-
-                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
+
+                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        ' and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ]
                 }
             },

+ 3 - 1
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -216,8 +216,10 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             });
             var fieldLabel = field.fieldLabel || field.name;
             var fieldValue = viewModel.get(fieldName);
+            if(Ext.isDate(fieldValue)) {
+                fieldValue = Ext.Date.format(fieldValue, 'Y-m-d');
+            }
             fields[fieldName] = fieldValue;
-            
             if(!fieldValue && nullFields.indexOf(fieldLabel) == -1) {
                 nullFields.push(fieldLabel);
             }

+ 115 - 10
frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js

@@ -381,6 +381,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
             status:status,
             refusereason:refusereason
         };
+        me.items.items[0].setLoading(true)
         Ext.Ajax.request({  
             url : '/api/purchase/purchase/inquiry/deal',
             timeout: 8000,  
@@ -392,6 +393,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
             method: 'POST',
             params:JSON.stringify(params),
             success: function(response, o){
+                me.items.items[0].setLoading(false)
                 var res = Ext.decode(response.responseText);
                 if(res.success){
                     me.down('grid').store.loadPage(1);
@@ -401,6 +403,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                 }
             },
             failure: function (response, opts) {
+                me.items.items[0].setLoading(false)
                 saas.util.BaseUtil.showErrorToast('操作失败,请重试');
             }
         });
@@ -411,7 +414,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
         var win = Ext.create('Ext.window.Window', {  
             renderTo: me.getEl(),
             cls:'x-window-dbfind', 
-            height: 260,
+            height: 230,
             width: 450,
             modal:true,
             title: '选择分段数量',
@@ -431,9 +434,13 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                 xtype:'grid',
                 frame:true,
                 anchor: '100% 100%',
-                width:206,
+                width:326,
+                margin:'5 0 0 0',
                 store:[],
-                height:138,
+                height:146,
+                plugins: [{
+                    ptype: 'menuclipboard'
+                }],
                 columns: [{
                     text: '分段数量',
                     dataIndex: 'lapQty',
@@ -446,18 +453,116 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                     dataIndex: 'price',
                     width: 90
                 },{
-                    text: '下单数量',
+                    text: '操作',
                     dataIndex: 'num',
-                    width: 90
+                    width: 120,
+                    renderer:function(v,m,r){
+                        return '<div style="width:100%;vertical-align: middle;    text-align: center;">'+
+                                    "<input type='button' value='选择' name='choose' style='border: 1px solid;color:#35baf6;cursor:pointer;background:#fff;'>"+
+                                '</div>';
+                    },
+                    listeners: {
+                        click: function (tableView, td, rowIdx, colIdx, e, model, tr) {
+                            let name = event.target.name;
+                            let _data = tableView.grid.store.data
+                            if(name == 'choose') {
+                                me.choose(_data,rowIdx,data);
+                                tableView.grid.ownerCt.close()
+                            }
+                        },
+                    }
                 }]
+            }]
+        });
+        win.show();
+    },
+    choose:function(data,rowIdx,row){
+        var me = this,minValue,maxValue = 999999999999999;
+        let nowRow = data.getAt(rowIdx);
+        let nextRow = data.getAt(rowIdx+1);
+        if(nextRow){
+            minValue = nowRow.data.lapQty
+            maxValue = nextRow.data.lapQty - 1
+        }else{
+            minValue = nowRow.data.lapQty
+        }
+        //显示弹窗
+        var win = Ext.create('Ext.window.Window', {  
+            renderTo: me.getEl(),
+            cls:'x-window-dbfind', 
+            height: 130,
+            width: 450,
+            modal:true,
+            title: '填写数量',
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout: {
+                type: 'hbox',
+                align: 'center'
+            },
+            items:[{
+                margin:'0 10 0 40',
+                labelWidth:60,
+                width:200,
+                minValue:minValue,
+                maxValue:maxValue,
+                xtype : "numberfield", 
+                decimalPrecision: 0,
+                name : "num",
+                fieldLabel : "数量"
             },{
-                margin:'20 0 0 0',
+                margin:'0 0 0 5',
                 xtype:'button',
-                text:'确认',
+                text:'确认下单',
                 handler:function(b){
-                    var refusereason = b.ownerCt.down('[name=refusereason]').value;
-                    me.sendMessage(id,status,refusereason);
-                    b.ownerCt.ownerCt.close();
+                    var num = b.ownerCt.down('[name=num]')
+                    if(!num.isValid()){
+                        saas.util.BaseUtil.showErrorToast('数量校验有误,请修改或重新选择分段');
+                    }
+                    var params = {
+                        id : row.id ,
+                        operate : row.agreed==1?0:1 ,
+                        prodCode : row.prodCode,
+                        vendName : row.vendName,
+                        vendUU : row.vendUU,
+                        userName : row.userName,
+                        tel : row.tel,
+                        taxRate : row.taxRate,
+                        price : nowRow.data.price,
+                        qty : num.value
+                    }
+                    b.ownerCt.setLoading(true)
+                    Ext.Ajax.request({  
+                        url : '/api/purchase/purchase/inquiry/turnPurchase',
+                        timeout: 8000,  
+                        headers:{
+                            'Access-Control-Allow-Origin': '*',
+                            'Authorization':  saas.util.State.get('session').token,
+                            "Content-Type": 'application/json;charset=UTF-8'
+                        },
+                        method: 'POST',
+                        params:JSON.stringify(params),
+                        success: function(response, o){
+                            b.ownerCt.setLoading(false)
+                            var res = Ext.decode(response.responseText);
+                            if(res.success){
+                                me.down('grid').store.loadPage(1);
+                                saas.util.BaseUtil.showSuccessToast('下单成功');
+                                //打开采购单
+                                var config = {};
+                                config.initId = res.data.id;
+                                saas.util.BaseUtil.openTab('purchase-purchase-formpanel', '采购订单('+res.data.code+')', 'purchase-purchase-formpanel-'+res.data.id, config);
+                                b.ownerCt.close()
+                            }else{
+                                saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
+                            }
+                        },
+                        failure: function (response, opts) {
+                            b.ownerCt.setLoading(false)
+                            saas.util.BaseUtil.showErrorToast('操作失败,请重试');
+                        }
+                    });
                 }
             }]
         });

+ 5 - 5
frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js

@@ -75,13 +75,13 @@ Ext.define('saas.view.purchase.b2b.sendQuotation.DataList', {
                     hidden:true
                 },{
                     text : '物料编号', 
-                    width : 200.0, 
+                    width : 150, 
                     dataIndex : 'pr_code', 
                     xtype : '', 
                 }, {
                     text : '品牌', 
                     dataIndex : 'pr_brand', 
-                    width : 110.0, 
+                    width : 100.0, 
                     xtype : '', 
                 }, {
                     text : '名称', 
@@ -90,15 +90,15 @@ Ext.define('saas.view.purchase.b2b.sendQuotation.DataList', {
                 },{
                     text : '型号', 
                     dataIndex : 'pr_orispeccode',
-                    width : 110.0
+                    width : 200.0
                 },{
                     text : '规格', 
                     dataIndex : 'pr_spec',
-                    width : 110.0
+                    width : 200.0
                 },{
                     text : '单位', 
                     dataIndex : 'pr_unit',
-                    width : 110.0
+                    width : 65.0
                 }],
                 getGridSelected:function(leadTime){
                     var me = this,

+ 5 - 4
frontend/saas-web/app/view/sale/b2b/Product.js

@@ -83,7 +83,7 @@ Ext.define('saas.view.sale.b2b.Product', {
                 columns : [{
                     text: '物料编号',
                     dataIndex: 'prodCode',
-                    width: 120
+                    width: 150
                 }, {
                     text: '品牌',
                     dataIndex: 'prodBrand',
@@ -91,17 +91,18 @@ Ext.define('saas.view.sale.b2b.Product', {
                 }, {
                     text: '名称',
                     dataIndex: 'prodName',
-                    width: 120
+                    width: 150
                 }, {
                     text: '型号',
                     dataIndex: 'prodOrispeccode',
-                    width: 120
+                    width: 200
                 }, {
                     text: '规格',
                     dataIndex: 'prodSpec',
-                    width: 120
+                    width: 200
                 }, {
                     text: '单位',
+                    width: 65.0,
                     dataIndex: 'prodUnit'
                 }, {
                     text: '上传状态',

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

@@ -105,6 +105,8 @@ Ext.define('saas.view.sale.b2b.recformpanel.FormPanelController', {
             item.data.sourceId = item.data.sourceid
             item.data.sourceTable = item.data.sourcetable
             item.data.status = 0
+            item.data.sourceDate = item.data.sourceDate
+            item.data.orderCode = item.data.ordercode
             item.data.receiveCode = item.data.receivecode
             item.data.receiveName = item.data.receivename
             item.data.prodCode  = item.data.prodcode

+ 4 - 3
frontend/saas-web/app/view/sale/b2b/reconciliation/DataList.js

@@ -1,5 +1,5 @@
 /**
- * 应收对账单
+ * 对账单详情
  */
 Ext.define('saas.view.sale.b2b.reconciliation.DataList', {
     extend: 'saas.view.core.base.BasePanel',
@@ -105,7 +105,7 @@ Ext.define('saas.view.sale.b2b.reconciliation.DataList', {
                     width : 110.0,
                 },{
                     text : '对账日期', 
-                    dataIndex : 'apDate', 
+                    dataIndex : 'recordDate', 
                     xtype:'datecolumn',
                     renderer:function(v,m,r){
                         if(v&&v!=''){
@@ -176,7 +176,8 @@ Ext.define('saas.view.sale.b2b.reconciliation.DataList', {
         var obj = {
             count:op.config.limit,
             page:op.config.page,
-            searchFilter:JSON.stringify(searchFilter)
+            searchFilter:JSON.stringify(searchFilter),
+            sorting:JSON.stringify({"recordDate":"desc"})
         };
 
         return obj;

+ 8 - 0
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -152,6 +152,14 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         dataIndex: 'pd_ordercode',
         width: 150
     }, {
+        text: '录入人',
+        dataIndex: 'creatorName',
+        width: 100
+    },{
+        text: '审核人',
+        dataIndex: 'pi_auditman',
+        width: 100
+    },{
         text: '备注',
         dataIndex: 'pd_remark',
         width: 250

+ 2 - 2
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -223,7 +223,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         },{
             xtype:'displayfield',
             margin:'0 0 0 150',
-            value:'支持 JPG、JPEG、PNG、BMP 格式 , 图片小于10M ',  
+            value:'支持 JPG、JPEG、PNG、BMP 格式 , 图片小于20M ',  
         },{
             xtype: 'image',
             width: 100,
@@ -352,7 +352,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         },{
             xtype:'displayfield',
             margin:'0 0 0 150',
-            value:'支持 JPG、JPEG、PNG、BMP 格式 , 图片小于10M ',  
+            value:'支持 JPG、JPEG、PNG、BMP 格式 , 图片小于20M ',  
         },{
             xtype: 'image',
             style:'border:1px solid #f7f7f7;',

BIN
frontend/saas-web/resources/images/default/delete.png


BIN
frontend/saas-web/resources/images/default/download.png