Browse Source

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

guq 6 years ago
parent
commit
67245ceb16
44 changed files with 671 additions and 123 deletions
  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. 1 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. 2 2
      frontend/saas-web/app/view/core/form/field/DetailGridField.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. 2 0
      frontend/saas-web/app/view/document/uusetting/UUSettingController.js
  25. 4 7
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  26. 0 14
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  27. 0 1
      frontend/saas-web/app/view/main/MainController.js
  28. 34 19
      frontend/saas-web/app/view/money/verification/FormPanel.js
  29. 3 1
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  30. 2 1
      frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js
  31. 5 5
      frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js
  32. 11 0
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  33. 3 0
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  34. 10 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  35. 20 0
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  36. 10 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  37. 20 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  38. 5 4
      frontend/saas-web/app/view/sale/b2b/Product.js
  39. 23 5
      frontend/saas-web/app/view/sale/b2b/QuoteWin.js
  40. 8 0
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  41. 2 2
      frontend/saas-web/app/view/sys/config/FormPanel.js
  42. 6 6
      frontend/saas-web/app/view/sys/guide/FormPanel.js
  43. BIN
      frontend/saas-web/resources/images/default/delete.png
  44. 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:

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

@@ -30,7 +30,7 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
         RedisTemplate redisTemplate = super.getRedisTemplate();
         redisTemplate.setHashKeySerializer(new StringRedisSerializer());
         redisTemplate.setHashValueSerializer(new Jackson2JsonRedisSerializer(Object.class));
-        return super.getRedisTemplate().boundHashOps(key());
+        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) {

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

@@ -37,7 +37,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
         addRows = function(id) {
             var grid = Ext.getCmp(id);
-            if(grid.editable) {
+            if(grid.editable && grid.fireEvent('beforeAddRow', grid, 0)) {
                 grid.addDetail(0);
             }
         };
@@ -225,7 +225,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     addDetail: function(v, d) {
         d = d || {};
         var me = this;
-        if(!me.editable) {
+        if(!me.editable || !me.fireEvent('beforeAddRow', me, v, d)) {
             return;
         }
         var detnoColumn = me.detnoColumn,

+ 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,

+ 2 - 0
frontend/saas-web/app/view/document/uusetting/UUSettingController.js

@@ -69,11 +69,13 @@ Ext.define('saas.view.document.uusetting.UUSettingController', {
         };
         if(kind == 'vendorkind') {
             if(!!record.get('ve_uu')) {
+                saas.util.BaseUtil.showErrorToast('不可重复设置UU');
                 return;
             }
             config.cname = record.get('ve_name');
         }else {
             if(!!record.get('cu_uu')) {
+                saas.util.BaseUtil.showErrorToast('不可重复设置UU');
                 return;
             }
             config.cname = record.get('cu_name');

+ 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);
             }

+ 2 - 1
frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js

@@ -519,6 +519,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                     var num = b.ownerCt.down('[name=num]')
                     if(!num.isValid()){
                         saas.util.BaseUtil.showErrorToast('数量校验有误,请修改或重新选择分段');
+                        return false;
                     }
                     var params = {
                         id : row.id ,
@@ -534,7 +535,7 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                     }
                     b.ownerCt.setLoading(true)
                     Ext.Ajax.request({  
-                        url : 'http://10.1.80.36:8560/api/purchase/purchase/inquiry/turnPurchase',
+                        url : '/api/purchase/purchase/inquiry/turnPurchase',
                         timeout: 8000,  
                         headers:{
                             'Access-Control-Allow-Origin': '*',

+ 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,

+ 11 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -18,6 +18,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     _auditdateField: 'pu_auditdate',
     _relationColumn: 'pd_puid',
     _readUrl: '/api/purchase/purchase/read',
+    // _readUrl: 'http://10.1.80.36:8560/api/purchase/purchase/read',
     _saveUrl: '/api/purchase/purchase/save',
     _auditUrl: '/api/purchase/purchase/audit',
     _unAuditUrl: '/api/purchase/purchase/unAudit',
@@ -104,6 +105,16 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     });
                     this.dialog.show();
                 }
+            }, {
+                xtype: "textfield",
+                name: "b2bStatus",
+                fieldLabel: "上传状态",
+                columnWidth: 0.25,
+                readOnly: true,
+                bind: {
+                    hidden: '{!enableB2B}'
+                },
+                defaultValue: '待上传'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 3 - 0
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -159,6 +159,9 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                     width:120,
                     hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
                     initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    renderer: function(v) {
+                        return v ? v : '待上传'
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'pu_remark',

+ 10 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -112,6 +112,16 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 fieldLabel: "采购单号",
                 allowBlank: true,
                 columnWidth: 0.25
+            }, {
+                xtype: "textfield",
+                name: "b2bStatus",
+                fieldLabel: "上传状态",
+                columnWidth: 0.25,
+                readOnly: true,
+                bind: {
+                    hidden: '{!enableB2B}'
+                },
+                defaultValue: '待上传'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 20 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -158,6 +158,16 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
                     text: '关联采购单号',
                     dataIndex: 'pi_pucode',
                     width: 150
+                }, {
+                    text: 'B2B上传状态',
+                    dataIndex: 'b2bStatus',
+                    textAlign: 'center',
+                    width:120,
+                    hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    renderer: function(v) {
+                        return v ? v : '待上传'
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'pi_remark',
@@ -288,6 +298,16 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
                     text: '关联采购单号',
                     dataIndex: 'pi_pucode',
                     width: 150
+                }, {
+                    text: 'B2B上传状态',
+                    dataIndex: 'b2bStatus',
+                    textAlign: 'center',
+                    width:120,
+                    hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    renderer: function(v) {
+                        return v ? v : '待上传'
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'pd_remark',

+ 10 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -108,6 +108,16 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 fieldLabel: "采购单号",
                 allowBlank: true,
                 columnWidth: 0.25
+            }, {
+                xtype: "textfield",
+                name: "b2bStatus",
+                fieldLabel: "上传状态",
+                columnWidth: 0.25,
+                readOnly: true,
+                bind: {
+                    hidden: '{!enableB2B}'
+                },
+                defaultValue: '待上传'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 20 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -164,6 +164,16 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
                     text: '关联验收单号',
                     dataIndex: 'pi_iocode',
                     width: 150
+                }, {
+                    text: 'B2B上传状态',
+                    dataIndex: 'b2bStatus',
+                    textAlign: 'center',
+                    width:120,
+                    hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    renderer: function(v) {
+                        return v ? v : '待上传'
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'pi_remark',
@@ -293,6 +303,16 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
                     text: '关联验收单号',
                     dataIndex: 'pi_iocode',
                     width: 150
+                }, {
+                    text: 'B2B上传状态',
+                    dataIndex: 'b2bStatus',
+                    textAlign: 'center',
+                    width:120,
+                    hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
+                    renderer: function(v) {
+                        return v ? v : '待上传'
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'pd_remark',

+ 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: '上传状态',

+ 23 - 5
frontend/saas-web/app/view/sale/b2b/QuoteWin.js

@@ -57,17 +57,23 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                         return false;
                     }
 
+                    let lastQ = 0;
                     for (var x = 0; x < gridData.length; x++) {
-                        var d = gridData[x];
-                        var idx = d.get('no');
+                        let d = gridData[x];
+                        let idx = d.get('no');
                         if (!d.get('lapQty')) {
                             saas.util.BaseUtil.showErrorToast('序号为' + idx + '的行梯度有误');
                             return false;
                         }
+                        if(d.get('lapQty') <= lastQ) {
+                            saas.util.BaseUtil.showErrorToast('序号为' + idx + '的行梯度需要大于上一梯度设置');
+                            return false;
+                        }
                         if(!d.get('price')) {
                             saas.util.BaseUtil.showErrorToast('序号为' + idx + '的行单价有误');
                             return false;
                         }
+                        lastQ = d.get('lapQty');
                     }
 
                     return true;
@@ -124,10 +130,12 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                             type: 'int'
                         }, {
                             name: 'lapQty',
-                            type: 'int'
+                            type: 'int',
+                            vtype: 'positiveNumber'
                         }, {
                             name: 'price',
-                            type: 'float'
+                            type: 'float',
+                            vtype: 'positiveNumber'
                         }],
                         data: []
                     }),
@@ -155,7 +163,17 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                         renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 4, true);
                         },
-                    }]
+                    }],
+                    listeners: {
+                        beforeaddrow: function(grid, index, data) {
+                            if(grid.store.getCount() < 5) {
+                                return true;
+                            }else {
+                                saas.util.BaseUtil.showErrorToast('最多只能设置5条梯度价格');
+                                return false;
+                            }
+                        }
+                    }
                 }, {
                     xtype: 'textfield',
                     name: 'message',

+ 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;',

+ 6 - 6
frontend/saas-web/app/view/sys/guide/FormPanel.js

@@ -57,7 +57,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
 				'<div class="x-guide-panel" align ="center">',
                     '<div class="x-guide-item" align ="center" >',
 
-                        '<figure style="margin: 0 185px 0 180px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'baseSet\')">',
+                        '<figure style="margin: 0px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'baseSet\')">',
                         '<img class="',
                             '<tpl if="!baseSet">x-guide-mask </tpl>',
                             '" src="resources/images/guide/baseSet.png" align ="center" width="135" height="90" alt="基础设置"  >',
@@ -66,7 +66,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '</figcaption>',
                         '</figure>',
                         
-                        '<figure style="margin:0 185px 0 0;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'warehouse\')">',
+                        '<figure style="margin:0 0 0 185px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'warehouse\')">',
                         '<img class="',
                         '<tpl if="!warehouse">x-guide-mask </tpl>',
                         '"src="resources/images/guide/warehouse.png" align ="center" width="135" height="90" alt="仓库资料"  >',
@@ -75,7 +75,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '</figcaption>',
                         '</figure>',
 
-                        '<figure style="margin:0 185px 0 0;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'product\')">',
+                        '<figure style="margin:0 0 0 185px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'product\')">',
                         '<img class="',
                         '<tpl if="!product">x-guide-mask </tpl>',
                         '"src="resources/images/guide/product.png" align ="center" width="135" height="90" alt="物料资料"  >',
@@ -116,7 +116,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                     '</div>',
                     '<div class="x-guide-item" align ="center">',
 
-                        '<figure style="margin: 40px 185px 0 182px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'customer\')">',
+                        '<figure style="margin: 20px 0 0 0;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'customer\')">',
                         '<img class="',
                         '<tpl if="!customer">x-guide-mask </tpl>',
                         '"src="resources/images/guide/customer.png" align ="center" width="135" height="90" alt="客户资料"  >',
@@ -125,7 +125,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '</figcaption>',
                         '</figure>',
 
-                        '<figure style="margin: 0px 185px 0 0px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'vendor\')">',
+                        '<figure style="margin:20px 0 0 185px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'vendor\')">',
                         '<img class="',
                         '<tpl if="!vendor">x-guide-mask </tpl>',
                         '"src="resources/images/guide/vendor.png" align ="center" width="135" height="90" alt="供应商资料"  >',
@@ -134,7 +134,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '</figcaption>',
                         '</figure>',
 
-                        '<figure style="margin: 0 185px 0 0px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'begin\',\'{begin}\')">',
+                        '<figure style="margin:20px 0 0 185px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'begin\',\'{begin}\')">',
                         '<img class="',
                         '<tpl if="!begin">x-guide-mask </tpl>',
                         '" src="resources/images/guide/begin.png" align ="center" width="135" height="90" alt="开始使用"  >',

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


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