Просмотр исходного кода

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

huangx 7 лет назад
Родитель
Сommit
699ba1a12f
64 измененных файлов с 679 добавлено и 214 удалено
  1. 6 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java
  2. 5 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/EmployeeServiceImpl.java
  3. 3 2
      applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml
  4. 44 41
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  5. 8 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  6. 1 1
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  7. 1 1
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  8. 1 1
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml
  9. 4 2
      base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java
  10. 4 0
      base-servers/auth/auth-api/pom.xml
  11. 10 0
      base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/AuthApi.java
  12. 6 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtToken.java
  13. 1 1
      base-servers/auth/auth-common/src/test/java/com/usoftchina/saas/auth/common/jwt/JwtHelperTest.java
  14. 29 0
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/config/CookieConfig.java
  15. 68 1
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  16. 4 1
      base-servers/auth/auth-server/src/main/resources/application.yml
  17. 49 4
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  18. 29 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/CookieConfig.java
  19. 3 0
      base-servers/gateway-server/src/main/resources/application.yml
  20. 3 2
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  21. 6 6
      frontend/saas-portal-web/src/components/conenter/company.vue
  22. 5 3
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  23. 63 6
      frontend/saas-portal-web/src/components/conenter/home.vue
  24. 2 2
      frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue
  25. 18 9
      frontend/saas-portal-web/src/components/footer/footer.vue
  26. 1 0
      frontend/saas-portal-web/src/pages/index/index.js
  27. 26 38
      frontend/saas-portal-web/static/css/main.css
  28. BIN
      frontend/saas-portal-web/static/img/banner@2x@2x.png
  29. BIN
      frontend/saas-portal-web/static/img/banner@3x@2x.png
  30. BIN
      frontend/saas-portal-web/static/img/feature/blue1@2x.png
  31. BIN
      frontend/saas-portal-web/static/img/feature/blue3@2x.png
  32. BIN
      frontend/saas-portal-web/static/img/feature/illustration1@2x.png
  33. BIN
      frontend/saas-portal-web/static/img/feature/illustration2@2x.png
  34. BIN
      frontend/saas-portal-web/static/img/feature/illustration3@2x.png
  35. BIN
      frontend/saas-portal-web/static/img/feature/illustration4@2x.png
  36. BIN
      frontend/saas-portal-web/static/img/feature/yellow2@2x.png
  37. BIN
      frontend/saas-portal-web/static/img/feature/yellow4@2x.png
  38. 9 2
      frontend/saas-web/app/Application.scss
  39. 2 0
      frontend/saas-web/app/util/FormUtil.js
  40. 21 0
      frontend/saas-web/app/view/core/base/BasePanel.js
  41. 1 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  42. 46 16
      frontend/saas-web/app/view/core/form/FormPanelController.js
  43. 9 7
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  44. 27 2
      frontend/saas-web/app/view/core/report/ReportPanel.js
  45. 42 11
      frontend/saas-web/app/view/core/report/ReportPanel.scss
  46. 0 1
      frontend/saas-web/app/view/document/customer/FormPanel.js
  47. 11 4
      frontend/saas-web/app/view/document/kind/ChildForm.js
  48. 9 0
      frontend/saas-web/app/view/document/product/FormController.js
  49. 2 12
      frontend/saas-web/app/view/document/product/FormModel.js
  50. 4 1
      frontend/saas-web/app/view/document/product/FormPanel.js
  51. 1 1
      frontend/saas-web/app/view/home/charts/PurchaseTrend.js
  52. 1 1
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  53. 1 1
      frontend/saas-web/app/view/home/charts/StockAmount.js
  54. 1 0
      frontend/saas-web/app/view/main/Main.js
  55. 2 2
      frontend/saas-web/app/view/money/report/PayDetail.js
  56. 1 1
      frontend/saas-web/app/view/money/report/RecDetail.js
  57. 3 3
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  58. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  59. 1 1
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  60. 2 2
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  61. 7 7
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  62. 4 2
      frontend/saas-web/app/view/stock/inventory/EditDataList.js
  63. 26 1
      frontend/saas-web/app/view/stock/make/FormPanel.js
  64. 45 1
      frontend/saas-web/app/view/viewport/ViewportController.js

+ 6 - 6
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java

@@ -20,16 +20,16 @@ public interface EmployeeMapper extends CommonBaseMapper<Employee> {
 
     List<EmployeeDTO> selectEmployeeListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
 
-    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
 
-    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
-    Integer validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
+    int validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
 
-    Integer validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
+    int validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
 
 
-    Integer validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
+    int validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
 
-    Integer validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long em_id,@Param("companyId") Long id);
+    int validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long id,@Param("companyId") Long companyId);
 }

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

@@ -65,10 +65,12 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
     @Override
     public DocBaseDTO saveFormData(Employee employee) {
         DocBaseDTO docBaseDTO = null;
-        String code = pushMaxnubmer(employee.getEm_code(), employee.getId());
+        Long companyId = BaseContextHolder.getCompanyId();
+        employee.setCompanyId(companyId);
         if(employee.getId() == 0){
+            String code = pushMaxnubmer(employee.getEm_code(), employee.getId());
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }
@@ -77,7 +79,6 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_TEL);
             }
-            employee.setCompanyId(BaseContextHolder.getCompanyId());
             employee.setCreatorId(BaseContextHolder.getUserId());
             employee.setCreateTime(new Date());
             employee.setCreatorName(BaseContextHolder.getUserName());
@@ -87,7 +88,7 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             messageLogService.save(docBaseDTO);
         }else{
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenUpdate(code,employee.getEm_name(),employee.getId(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenUpdate(employee.getEm_code(),employee.getEm_name(),employee.getId(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }

+ 3 - 2
applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml

@@ -239,8 +239,9 @@
   <select id="validateNameAndCodeWhenInsert" resultType="int">
     select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and companyId =#{companyId}
   </select>
-  <select id="validateNameAndCodeWhenUpdate" resultType="int" >
-    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id} and companyId =#{companyId}
+  
+  <select id="validateNameAndCodeWhenUpdate" resultType="int">
+    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id}  and companyId =#{companyId}
   </select>
 
 

+ 44 - 41
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java

@@ -98,7 +98,6 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         }
 
         String res = null;
-        VendOrCustAdd vendOrCustAdd = new VendOrCustAdd();
         List<Map<String, Double>> list1 = new ArrayList<>();
         if ("Supplier".equals(type)) {
             list = vendorAcountViewMapper.selectByCondition(con, companyId);
@@ -107,26 +106,28 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Integer vid = new Integer(0);
                 vid = vendorAcountViewMapper.getId(vendorAcountView.getPi_vendcode(), Long.valueOf(vendorAcountView.getCompanyId()));
                 Integer ym = Integer.valueOf(req.getYm());
-                vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, ym, Long.valueOf(vendorAcountView.getCompanyId()));
-                vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                        + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                        - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
-                //封装成list
-                Map<String, Double> map1 = new HashMap<>();
-                map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                list1.add(map1);
-
-                Map<String, Double> map2 = new HashMap<>();
-                map2.put("nowamount", vendOrCustAdd.getNowamount());
-                list1.add(map2);
-
-                Map<String, Double> map3 = new HashMap<>();
-                map3.put("nowpay", vendOrCustAdd.getNowpay());
-                list1.add(map3);
-
-                Map<String, Double> map4 = new HashMap<>();
-                map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                list1.add(map4);
+                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, ym, Long.valueOf(vendorAcountView.getCompanyId()));
+                if (vendOrCustAdd != null) {
+                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
+                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
+                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
+                    //封装成list
+                    Map<String, Double> map1 = new HashMap<>();
+                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
+                    list1.add(map1);
+
+                    Map<String, Double> map2 = new HashMap<>();
+                    map2.put("nowamount", vendOrCustAdd.getNowamount());
+                    list1.add(map2);
+
+                    Map<String, Double> map3 = new HashMap<>();
+                    map3.put("nowpay", vendOrCustAdd.getNowpay());
+                    list1.add(map3);
+
+                    Map<String, Double> map4 = new HashMap<>();
+                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
+                    list1.add(map4);
+                }
             }
         } else if("payDetail".equals(type)){
             list = paydetailViewMapper.selectByCondition(con, companyId);
@@ -154,26 +155,28 @@ public class MoneyReportServiceImpl implements MoneyReportService {
 
                 vid = customerCheckViewMapper.getId(customerCheckView.getPi_custcode(), Long.valueOf(customerCheckView.getCompanyId()));
                 Integer ym = Integer.valueOf(req.getYm());
-                vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, ym, Long.valueOf(customerCheckView.getCompanyId()));
-                vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                        + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                        - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
-                //封装成list
-                Map<String, Double> map1 = new HashMap<>();
-                map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                list1.add(map1);
-
-                Map<String, Double> map2 = new HashMap<>();
-                map2.put("nowamount", vendOrCustAdd.getNowamount());
-                list1.add(map2);
-
-                Map<String, Double> map3 = new HashMap<>();
-                map3.put("nowpay", vendOrCustAdd.getNowpay());
-                list1.add(map3);
-
-                Map<String, Double> map4 = new HashMap<>();
-                map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                list1.add(map4);
+                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, ym, Long.valueOf(customerCheckView.getCompanyId()));
+                if (vendOrCustAdd != null) {
+                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
+                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
+                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
+                    //封装成list
+                    Map<String, Double> map1 = new HashMap<>();
+                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
+                    list1.add(map1);
+
+                    Map<String, Double> map2 = new HashMap<>();
+                    map2.put("nowamount", vendOrCustAdd.getNowamount());
+                    list1.add(map2);
+
+                    Map<String, Double> map3 = new HashMap<>();
+                    map3.put("nowpay", vendOrCustAdd.getNowpay());
+                    list1.add(map3);
+
+                    Map<String, Double> map4 = new HashMap<>();
+                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
+                    list1.add(map4);
+                }
             }
         }else if ("accountdetails".equals(type)){
             list = accountDetailsViewMapper.selectByCondition(con, companyId);

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

@@ -404,7 +404,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         double pdQty=0, pdYqty=0;
         //检查转单状态
         String acceptstatus = purchase.getPu_acceptstatuscode();
-
         if (Status.CLOSE.name().equals(acceptstatus)){
             return Result.error(ExceptionCode.CLOSED_EXIST);
         }
@@ -530,12 +529,19 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     @Transactional
     public void singleUnAudit(Long id) {
-        Purchase purchase = new Purchase();
+        //校验关闭状态
+        Purchase purchase = getMapper().selectByPrimaryKey(id);
+        //检查转单状态
+        String acceptstatus = purchase.getPu_acceptstatuscode();
+        if (Status.CLOSE.name().equals(acceptstatus)){
+            throw new  BizException(ExceptionCode.CLOSED_EXIST);
+        }
         //检查是否已转验收单
         Integer num = getMapper().checkTurnInstatus(id);
         if (num > 0) {
             throw new BizException(BizExceptionCode.PURCHASE_UNAUDIT_ERROR);
         }
+        purchase = new Purchase();
         //生成更新对象
         purchase.setId(id);
         purchase.setPu_status(Status.UNAUDITED.getDisplay());

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

@@ -415,7 +415,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

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

@@ -402,7 +402,7 @@
     and purchasedetail.companyid= #{companyid}
   </select>
   <select id="checkCustomer" parameterType="long" resultType="integer">
-    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and cu_statuscode='CLOSE'
+    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and sa_id=#{id}
   </select>
   
   <!-- 销售订单转采购单-->

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

@@ -403,7 +403,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 4 - 2
base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.account.api;
 
 import com.usoftchina.saas.account.cache.AccountCache;
+import com.usoftchina.saas.context.BaseContextHolder;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -17,7 +18,8 @@ public class AccountCacheTest {
 
     @Test
     public void hdel() {
-        AccountCache.of(43).hdel();
-        System.out.println(AccountCache.of(43).exists());
+//        AccountCache.of(43).hdel();
+        BaseContextHolder.setToken("eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWx5IiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjQzLCJjb21wYW55SWQiOjEsInVzZXJOYW1lIjoic3VseSIsInJlYWxOYW1lIjoi6IuP54G16LCjIiwiZXhwIjoxNTQzNDg5NjM0fQ.oqOIqO97zAH2W1RZsofmCstKHNYsQlnMr_UkOw69zw175fhAefysux2njV1FEbldTQA62RiQ7JrnntWPqOmsNmrBsD0cwvy9xkUma3CNjIuZirbg09CYjUVIFnDpwz-WpmZMQFDIBVQYchCDRzDUgPYPB4phptCGNpTG6VpztPo");
+        System.out.println(AccountCache.of(43).getAccount());
     }
 }

+ 4 - 0
base-servers/auth/auth-api/pom.xml

@@ -17,6 +17,10 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>auth-dto</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-common</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>core</artifactId>

+ 10 - 0
base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/AuthApi.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.auth.api;
 
+import com.usoftchina.saas.auth.common.cookie.CookieInfo;
 import com.usoftchina.saas.auth.dto.AuthDTO;
 import com.usoftchina.saas.auth.dto.TokenDTO;
 import com.usoftchina.saas.base.Result;
@@ -40,4 +41,13 @@ public interface AuthApi {
      */
     @GetMapping("/info")
     Result<AuthDTO> getInfo();
+
+    /**
+     * 使用账户中心登录cookie信息产生token登录
+     *
+     * @param info
+     * @return
+     */
+    @PostMapping(value = "/sso/authorize")
+    Result<AuthDTO> ssoAuthorize(CookieInfo info);
 }

+ 6 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtToken.java

@@ -24,6 +24,12 @@ public class JwtToken implements Serializable {
         this.timestamp = System.currentTimeMillis();
     }
 
+    public JwtToken(String token, Integer expire, Long timestamp) {
+        this.token = token;
+        this.expire = expire;
+        this.timestamp = timestamp;
+    }
+
     public String getToken() {
         return token;
     }

+ 1 - 1
base-servers/auth/auth-common/src/test/java/com/usoftchina/saas/auth/common/jwt/JwtHelperTest.java

@@ -9,7 +9,7 @@ public class JwtHelperTest {
 
     @org.junit.Test
     public void getInfoFromToken() throws Exception {
-        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWx5IiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjQzLCJjb21wYW55SWQiOjEsInVzZXJOYW1lIjoic3VseSIsInJlYWxOYW1lIjoi6IuP54G16LCjIiwiZXhwIjoxNTQzNDExNzY0fQ.KMZV5H4tH4ifYBmY7rV4HSsW1fZHU2k-Yl47b9C3bt6S1_BqzTO-RbVDNMR-WXHpHFwXiq0aoHbqaA512z_-icLPcmeCb2TmnERisgjhnqn7OYordtAWahNlZfiaExnnttLvcNHQSiOWK9vYxxHnf2gC34XdKI0Bo8QZRSR3eo8";
+        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWx5IiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjQzLCJjb21wYW55SWQiOjEsInVzZXJOYW1lIjoic3VseSIsInJlYWxOYW1lIjoi6IuP54G16LCjIiwiZXhwIjoxNTQzNDg5NjM0fQ.oqOIqO97zAH2W1RZsofmCstKHNYsQlnMr_UkOw69zw175fhAefysux2njV1FEbldTQA62RiQ7JrnntWPqOmsNmrBsD0cwvy9xkUma3CNjIuZirbg09CYjUVIFnDpwz-WpmZMQFDIBVQYchCDRzDUgPYPB4phptCGNpTG6VpztPo";
         String keyPath = "pub.key";
         JwtInfo info = JwtHelper.getInfoFromToken(token, keyPath);
     }

+ 29 - 0
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/config/CookieConfig.java

@@ -0,0 +1,29 @@
+package com.usoftchina.saas.auth.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * @author yingp
+ * @date 2018/11/29
+ */
+@ConfigurationProperties("auth.cookie")
+public class CookieConfig {
+    private String name;
+    private String secretKey;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+}

+ 68 - 1
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -7,10 +7,13 @@ import com.usoftchina.saas.account.dto.AccountCopyDTO;
 import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.account.dto.AccountUpdateDTO;
 import com.usoftchina.saas.account.dto.CompanyBaseDTO;
+import com.usoftchina.saas.auth.common.cookie.CookieHelper;
 import com.usoftchina.saas.auth.common.cookie.CookieInfo;
+import com.usoftchina.saas.auth.common.cookie.CookieUtils;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
 import com.usoftchina.saas.auth.common.jwt.JwtToken;
+import com.usoftchina.saas.auth.config.CookieConfig;
 import com.usoftchina.saas.auth.dto.AuthDTO;
 import com.usoftchina.saas.auth.dto.AuthorizeLogDTO;
 import com.usoftchina.saas.auth.dto.TokenDTO;
@@ -30,6 +33,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.http.server.reactive.ServerHttpRequest;
+import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -45,6 +51,7 @@ import java.util.List;
  */
 @RestController
 @RequestMapping
+@EnableConfigurationProperties(CookieConfig.class)
 public class AuthController {
 
     @Autowired
@@ -65,6 +72,9 @@ public class AuthController {
     @Value("${auth.max-errors:5}")
     private int maxErrors;
 
+    @Autowired
+    private CookieConfig cookieConfig;
+
     @Autowired
     private AuthorizeLogService authorizeLogService;
 
@@ -151,6 +161,53 @@ public class AuthController {
         return Result.success(new AuthDTO(tokenDTO, accountDTO));
     }
 
+    /**
+     * 使用账户中心登录cookie信息产生token登录
+     *
+     * @param info
+     * @return
+     */
+    @GetMapping("/sso/authorize")
+    public Result<AuthDTO> ssoAuthorize(HttpServletRequest request, HttpServletResponse response, CookieInfo info) throws IOException{
+        if (null != info && null != info.getMobile()) {
+            AccountDTO accountDTO = null;
+            Result<AccountDTO> result = accountApi.getAccount(info.getMobile());
+            if (!result.isSuccess()) {
+                if (ExceptionCode.USER_NOT_EXIST.getCode() == result.getCode()) {
+                    // 新用户,自动注册
+                    accountDTO = createAccountByCookieInfo(info);
+                } else {
+                    return Result.error(result);
+                }
+            } else {
+                accountDTO = result.getData();
+                // 检测uu是否正确
+                if (null == accountDTO.getUu() || !info.getUserUU().equals(accountDTO.getUu())) {
+                    accountDTO.setUu(info.getUserUU());
+                    Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
+                    if (!updateResult.isSuccess()) {
+                        return Result.error(updateResult);
+                    }
+                }
+            }
+            // TODO
+            String appId = "trade-app";
+            // 登录日志
+            authorizeLogService.save(AuthorizeLog.from(request)
+                    .setAccountId(accountDTO.getId())
+                    .setAppId(appId).build());
+            Long companyId = null;
+            if (!CollectionUtils.isEmpty(accountDTO.getCompanies())) {
+                companyId = accountDTO.getCompanies().get(0).getId();
+            }
+            JwtInfo jwtInfo = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
+            JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
+            TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
+            return Result.success(new AuthDTO(tokenDTO, accountDTO));
+        }
+        return Result.error(ExceptionCode.COOKIE_ILLEGAL_ARGUMENT);
+    }
+
     /**
      * 账户中心登录时jsonp回调
      *
@@ -261,8 +318,18 @@ public class AuthController {
      * @return
      */
     @GetMapping("/info")
-    public Result<AuthDTO> getInfo(HttpServletRequest request) {
+    public Result<AuthDTO> getInfo(HttpServletRequest request, HttpServletResponse response) throws IOException{
         String token = request.getHeader(authHeader);
+        if (StringUtils.isEmpty(token)) {
+            // 解析cookie获取身份
+            CookieInfo info = CookieHelper.geInfoFromRequest(request,
+                    cookieConfig.getName(), cookieConfig.getSecretKey());
+            if (null != info) {
+                return ssoAuthorize(request, response, info);
+            } else {
+                return Result.error(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
+            }
+        }
         JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, publicKeyPath);
         Result<AccountDTO> result = accountApi.getAccount(infoFromToken.getUserName());
         if (result.isSuccess()) {

+ 4 - 1
base-servers/auth/auth-server/src/main/resources/application.yml

@@ -81,4 +81,7 @@ mybatis:
   mapper-locations: classpath:mapper/*.xml
 auth:
   private-key: auth/pri.key
-  public-key: auth/pub.key
+  public-key: auth/pub.key
+  cookie:
+    name: uid
+    secret-key: 0taQcW073Z7G628g5H

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

@@ -4,8 +4,14 @@ import com.usoftchina.saas.account.cache.AccountCache;
 import com.usoftchina.saas.account.cache.ResourceCache;
 import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.account.dto.UrlResourceDTO;
+import com.usoftchina.saas.auth.api.AuthApi;
+import com.usoftchina.saas.auth.common.cookie.CookieHelper;
+import com.usoftchina.saas.auth.common.cookie.CookieInfo;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
+import com.usoftchina.saas.auth.dto.AuthDTO;
+import com.usoftchina.saas.auth.dto.TokenDTO;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
@@ -34,18 +40,27 @@ import java.util.stream.Collectors;
  * @date 2018/10/13
  */
 @Configuration
-@EnableConfigurationProperties(AuthConfig.class)
+@EnableConfigurationProperties({
+        AuthConfig.class,
+        CookieConfig.class
+})
 public class AuthFilter implements GlobalFilter, Ordered {
 
     @Autowired
     private AuthConfig authConfig;
 
+    @Autowired
+    private CookieConfig cookieConfig;
+
+    @Autowired
+    private AuthApi authApi;
+
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
         try {
             if (!isIgnore(exchange.getRequest())) {
                 // 鉴别身份信息
-                String token = getAuthHeaderToken(exchange.getRequest());
+                String token = getAuthToken(exchange.getRequest());
                 JwtInfo jwt = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
                 BaseContextHolder.setAppId(jwt.getAppId());
                 BaseContextHolder.setUserId(jwt.getUserId());
@@ -121,10 +136,17 @@ public class AuthFilter implements GlobalFilter, Ordered {
                 new AntPathRequestMatcher(ignore).matches(request));
     }
 
-    private String getAuthHeaderToken(ServerHttpRequest request) {
+    private String getAuthToken(ServerHttpRequest request) {
+        // from header
         if (!request.getHeaders().containsKey(authConfig.getAuthHeader())) {
-            throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
+            // from cookie
+            String token = getAuthCookieInfo(request);
+            if (null == token) {
+                throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
+            }
+            return token;
         }
+
         List<String> headers = request.getHeaders().get(authConfig.getAuthHeader());
         if (headers.isEmpty()) {
             throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
@@ -132,6 +154,29 @@ public class AuthFilter implements GlobalFilter, Ordered {
         return headers.get(0).trim();
     }
 
+    /**
+     * 解析cookie获取身份
+     *
+     * @param request
+     * @return
+     */
+    private String getAuthCookieInfo(ServerHttpRequest request) {
+        if (request.getCookies().containsKey(cookieConfig.getName())) {
+            String value = request.getCookies().getFirst(cookieConfig.getName()).getValue();
+            CookieInfo info = CookieHelper.geInfoFromToken(value, cookieConfig.getSecretKey());
+            Result<AuthDTO> result = authApi.ssoAuthorize(info);
+            if (result.isSuccess()) {
+                TokenDTO token = result.getData().getToken();
+                // 传递身份信息到后面代理的服务
+                request.getHeaders().add(authConfig.getAuthHeader(), token.getToken());
+                return token.getToken();
+            } else {
+                throw new BizException(result.getCode(), result.getMessage());
+            }
+        }
+        return null;
+    }
+
     @Override
     public int getOrder() {
         return -100;

+ 29 - 0
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/CookieConfig.java

@@ -0,0 +1,29 @@
+package com.usoftchina.saas.gateway.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * @author yingp
+ * @date 2018/11/29
+ */
+@ConfigurationProperties("auth.cookie")
+public class CookieConfig {
+    private String name;
+    private String secretKey;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+}

+ 3 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -185,3 +185,6 @@ auth:
     - /api/auth/info
     - /ws/**
     - /api/file/download
+  cookie:
+    name: uid
+    secret-key: 0taQcW073Z7G628g5H

+ 3 - 2
frontend/saas-portal-web/src/components/conenter/addgongsi.vue

@@ -63,7 +63,7 @@
                     <ul>
                         <li style="margin:0">
                             <span class="qy-biaoti"><span class="xingxing">*</span>姓名</span>
-                            <input class="inpind" @change= "yzusername" ref="name" type="text">
+                            <input class="inpind" @change= "yzusername" ref="name" type="text" value="">
                             <div class="qy-Tips Tips-buttom"><span ref="usname" style="color:red"></span></div>
                         </li>
                         <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
@@ -102,7 +102,8 @@ import VDistpicker from 'v-distpicker'
             VDistpicker
         },
         mounted(){
-
+            this.$refs.name.value = this.mytoken.account.realname
+            this.$refs.email.value = this.mytoken.account.email
         },
         methods: {
             //取消添加企业

+ 6 - 6
frontend/saas-portal-web/src/components/conenter/company.vue

@@ -38,9 +38,9 @@
       <div>
         <div class="tc-okkaitong"><span>该企业已开通服务,联系管理员邀请加入</span></div>
         <div class="tc-context">
-          <p><span>管理员:</span><span>{{arr[0].admin}}</span></p>
-          <p><span>管理员手机号:</span><span>{{mytoken.account.mobile}}</span></p>
-          <p><span>管理员邮箱:</span><span></span></p>
+          <p><span>saas服务管理员:</span><span>{{arr[0].admin}}</span></p>
+          <p><span>saas服务管理员手机号:</span><span>{{mytoken.account.mobile}}</span></p>
+          <p><span>saas服务管理员邮箱:</span><span></span></p>
         </div>
       </div>
     </div>
@@ -62,7 +62,7 @@
                 <div class="left gs-xqleft" @click= "getEnterpriseInfo(d)">
                     <div class="gs-lefttext">
                         <p class="gs-qynema"><span>企业名称:</span>{{d.name}}</p>
-                        <p><span>管理员:</span>{{d.admin}}</p>
+                        <p v-if= "d.saas_" ><span>saas服务管理员:</span>{{d.admin}}</p>
                         <p v-if= "d.time"><span>开通日期:</span>{{d.time}}</p>
                     </div>
                 </div>
@@ -149,8 +149,7 @@
                         }
                     }
                     this.$store.commit('Loginfalse')
-                    // console.log(res.data.data)
-                    this.$store.state.email = this.arr[0].adminEmail
+                    this.$store.state.email = res.data.data.spaces[0].adminEmail
                 })
                 .catch(err=>{
                     // console.log("请求失败",err)
@@ -258,6 +257,7 @@
                     // console.log('请求成功',res)
                     if (res.data.success) {
                         this.ktsass = false;
+                        this.saasid = res.data.data
                     } else {
                         this.isokopensaas = true;
                     }

+ 5 - 3
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -71,7 +71,7 @@
                     </div>
                 </div>
     <!-- 安全信息----------------------------------------------------------------------------- -->
-                <!-- <sjld></sjld> -->
+
                 <div :class="{gsqiye:nowindex == 2}">
                     <div class="gs-anquanxinxi">
                         <div class="over aq-title"><span class="left">登录密码</span><button class="right dianji">更换密码</button></div>
@@ -111,7 +111,6 @@ import { setTimeout } from 'timers';
             return{
                 nowindex: 0,//tab切换
                 tianjiaqiye: true,//添加企业切换
-                email: this.$store.state.email,
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')).account,//本地储存的用户信息
                 tab: [
                     {name: '企业信息'},
@@ -123,10 +122,13 @@ import { setTimeout } from 'timers';
         computed :{
             setTokenPage() {
                 return this.$url.web + '/set-token.html'
+            },
+            email(){
+                return this.$store.state.email
             }
         },
         mounted(){
-
+            
         },
         methods: {
             // tab切换

+ 63 - 6
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -68,7 +68,7 @@
             <span><img style="margin: 6px 8px 10px 15px;" src="/static/img/assets/phone.png" alt=""></span>
             <input ref="typhone" type="text" placeholder="请输入您的11位手机号">
           </div>
-          <div class="left" style="margin-left: 8px;"><button @click="experience1">立即体验</button></div>
+          <div class="left" style="margin-left: 8px;"><button @click="openexperience">立即体验</button></div>
         </div>
         <div style="text-align: left;">
           <span class="Caution" ref="Caution"></span>
@@ -87,7 +87,7 @@
                  data-slice1-scale="2" data-slice2-scale="2">
               <div class="mask-overly"></div>
               <div class="bg-img slider-1">
-                <img src="/static/img/banner@3x@2x.png" alt="">
+                <img src="/static/img/banner@2x@2x.png" alt="">
               </div>
               <!-- 首页内容 -->
               <div class="my-text">
@@ -111,19 +111,40 @@
             <p class="ts-title">我们的特色</p>
             <p class="ts-text">云端部署 &nbsp;&nbsp; 轻量应用</p>
           </div>
+          <!-- 1 -->
+          <div class="ts-box">
+            <div class="ts-boximg">
+              <img src="/static/img/feature/illustration1@2x.png" alt="">
+            </div>
+            <div>
+              <img class="ts-img" src="/static/img/feature/blue1@2x.png" alt="">
+            </div>
+          </div>
+          <!-- 2 -->
           <div class="ts-box">
             <div>
-              <img class="ts-img" src="/static/img/assets/1@2x.png" alt="">
+              <img class="ts-img" src="/static/img/feature/yellow2@2x.png" alt="">
+            </div>
+            <div class="ts-boximg" style="right:0">
+              <img src="/static/img/feature/illustration2@2x.png" alt="">
             </div>
           </div>
+          <!-- 3 -->
           <div class="ts-box">
+            <div class="ts-boximg">
+              <img src="/static/img/feature/illustration3@2x.png" alt="">
+            </div>
             <div>
-              <img class="ts-img" src="/static/img/assets/2@3x.png" alt="">
+              <img class="ts-img" src="/static/img/feature/blue3@2x.png" alt="">
             </div>
           </div>
+          <!-- 4 -->
           <div class="ts-box">
             <div>
-              <img class="ts-img" src="/static/img/assets/3@2x.png" alt="">
+              <img class="ts-img" src="/static/img/feature/yellow4@2x.png" alt="">
+            </div>
+            <div class="ts-boximg" style="right:0">
+              <img src="/static/img/feature/illustration4@2x.png" alt="">
             </div>
           </div>
         </div>
@@ -136,6 +157,7 @@
           <div class="row">
             <div class="section-title text-center" style="margin-bottom: 80px;">
               <p class="ts-title">我们的功能</p>
+              <p class="ts-text">简易SCM+内部协同+外部连接</p>
             </div>
             <div class="gn-hei">
               <div class="col-md-3 col-sm-6 col-xs-12">
@@ -316,6 +338,26 @@
         Nowindex: 0,
       }
     },
+    created(){
+      var uid = this.getCookie('uid');
+      if(uid){
+        this.$ajax({
+          url: '/api/auth/info',
+          method: 'get',
+          async:false,
+          withCredentials:true
+        })
+        .then(res=>{
+          const data=res.data.data,session = data.token, account = data.account
+          account.companies = account.companies || []
+          session.account = account
+          Session.set(session);
+        })
+        .catch(err=>{
+          console.log("请求失败",err)
+        })
+      }
+    },
     mounted() {
       this.clientId = Math.random().toString(36).substr(2)
       // 从本地加载已经登录的信息
@@ -337,6 +379,20 @@
       }
     },
     methods: {
+        getCookie(cookieName){  
+          var cookieValue="";  
+          if (document.cookie && document.cookie != '') {   
+              var cookies = document.cookie.split(';');  
+              for (var i = 0; i < cookies.length; i++) {   
+                  var cookie = cookies[i];  
+                  if (cookie.substring(0, cookieName.length + 2).trim() == cookieName.trim() + "=") {  
+                        cookieValue = cookie.substring(cookieName.length + 2, cookie.length);   
+                        break;  
+                  }  
+              }  
+          }   
+          return cookieValue;  
+      }, 
       tab(i){
         this.Nowindex = i;
       },
@@ -394,6 +450,7 @@
       },
       //体验
       experience(){
+        console.log(123)
         this.isexperience = true;
       },
       //关闭体验
@@ -401,7 +458,7 @@
         this.isexperience = false;
       },
       //进入体验
-      experience1(){
+      openexperience(){
         let me = this
         let phone = this.$refs.typhone.value;
         let reg = new RegExp('^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$')

+ 2 - 2
frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue

@@ -19,7 +19,7 @@
             </div>
             <div class="gs-worp qy-worp" style="width:100%">
                 <div class="qy-title">
-                    <span>管理员信息</span>
+                    <span>saas服务管理员信息</span>
                 </div>
                 <div class="qy-conent">
                     <ul>
@@ -78,7 +78,7 @@
             </div>
             <div class="gs-worp qy-worp" style="width: 100%">
                 <div class="qy-title">
-                    <span>管理员信息</span>
+                    <span>saas服务管理员信息</span>
                 </div>
                 <div class="qy-conent">
                     <ul>

+ 18 - 9
frontend/saas-portal-web/src/components/footer/footer.vue

@@ -4,12 +4,19 @@
 			<div class="container">
 				<div class="footer-list">
 					<div class="about">
-						<div class="logo"><img src="../../../static/img/logo_w.png" alt=""/></div>
+						<!-- <div class="logo"><img src="../../../static/img/logo_w.png" alt=""/></div> -->
+						<div class="logo"><img src="/static/img/assets/dalogo@2x_1.png" alt=""/></div>
 						<div class="time">客服热线:400-830-1818</div>
 						<div class="time">工作时间:周一至周五08:30~18:00</div>
 						<!--<div class="time">意见反馈:usoftmall.com</div>-->
 					</div>
 					<div class="link">
+						<ul>
+							<li><span>常用链接:</span></li>
+							<li><a href="https://uas.usoftchina.com/" target="_blank">UAS官网</a></li>
+							<li><a href="https://www.usoftchina.com/" target="_blank">U软云</a></li>
+							<li><a href="http://www.yitoa.com/" target="_blank">英唐官网</a></li>
+						</ul>
 						<ul>
 							<li><span>帮助中心</span></li>
 							<li><a href="#">常见问题</a></li>
@@ -18,21 +25,22 @@
 						<ul>
 							<li><span>公司</span></li>
 							<li><a href="https://uas.usoftchina.com/about" target="_blank">关于我们</a></li>
-							<!-- <li><a href="#">企业文化</a></li> -->
+							<li><a >企业文化</a></li>
+							<li><a >联系我们</a></li>
 						</ul>
 						<ul>
 							<li><span>产品</span></li>
-							<li><a href="#">U企云服</a></li>
-							<li><a href="https://mall.usoftchina.com/" target="_blank">U软商城</a></li>
-							<li><a href="https://fin.yitoa-fintech.com/" target="_blank">U智融</a></li>
-							<li><a href="https://zb.usoftchina.com/" target="_blank">U创客</a></li>
+							<li><a href="#">企云服</a></li>
+							<li><a href="https://mall.usoftchina.com/" target="_blank">软商城</a></li>
+							<li><a href="https://fin.yitoa-fintech.com/" target="_blank">智融</a></li>
+							<li><a href="https://zb.usoftchina.com/" target="_blank">闯客网</a></li>
 						</ul>
 					</div>
 					
 					<div class="qr">
 						<div class="qr-top">
 							<div class="qr-tech qr-code">
-								<img src="../../../static/img/qr-tech.png" alt="">
+								<img src="/static/img/qr-tech.png" alt="">
 								<div class="db-text">
 									<span>科技公众号</span>
 								</div>
@@ -53,12 +61,13 @@
 			</div>
 		</div>
 		<div class="friend-link">
-			<ul>
+			<span>版权所有:深圳市优软科技有限公司 Copyright @ 2017 All Rights Reserved</span>
+			<!-- <ul>
 				<li><span>常用链接:</span></li>
 				<li><a href="https://uas.usoftchina.com/" target="_blank">UAS官网</a></li>
 				<li><a href="https://www.usoftchina.com/" target="_blank">U软云</a></li>
 				<li><a href="http://www.yitoa.com/" target="_blank">英唐官网</a></li>
-			</ul>
+			</ul> -->
 		</div>
     </div>
 </template>

+ 1 - 0
frontend/saas-portal-web/src/pages/index/index.js

@@ -5,6 +5,7 @@ import router from '../../router'
 import Axios from 'axios'
 import store from '../../store'
 
+Axios.defaults.withCredentials=true;
 Vue.prototype.$ajax = Axios;
 Vue.config.productionTip = false
 

+ 26 - 38
frontend/saas-portal-web/static/css/main.css

@@ -308,14 +308,18 @@ main > section {
 /* 首页内容 ..........................................*/
 .my-text {
     position: absolute;
+    width: 13%;
+    height: 6%;
     top: 64%;
-    left: 7%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    z-index: 1000;
 }
 .my-tiyan {
     background: #5172DD;
     border-radius: 4px;
-    width: 100px;
-    height: 36px;
+    width: 100%;
+    height: 100%;
     font-family: PingFangSC-Regular;
     font-size: 14px;
     color: #FFFFFF;
@@ -332,36 +336,11 @@ main > section {
     overflow: hidden;
     /* margin-top: 50px; */
     position: relative;
+    padding: 150px 0;
 }
-.ts-minimg {
-    width: 773px;
-    height: 615px;
-    position: absolute;
-    top: -35px;
-    right: 0;
-}
-.ts-mintext {
+.ts-boximg {
     position: absolute;
-    top: 142px;
-    right: 240px;
-    color: white;
-}
-.ts-mintext p {
-    font-size: 26px!important;
-    text-align: left;
-    margin-bottom: 24px;
-}
-.ts-textimg {
-    width: 40px;
-    margin-left: -40px;
-}
-.ts-lefttext {
-    left: 40px;
-    width: 560px;
-}
-.ts-textleftimg {
-    width: 40px;
-    margin-right: -40px;
+    top: 40px;
 }
 .ts-lefttext p {
     text-align: right;
@@ -553,7 +532,7 @@ main > section {
 }
 .footer-section ul{
     float: left;
-    margin-right: 70px;
+    margin-right: 45px;
 }
 .footer-section ul:last-child {
     margin-right: 0;
@@ -570,7 +549,7 @@ main > section {
 .footer-section ul>li a{
     display: inline-block;
     margin-bottom: 10px;
-    font-size: 12px;
+    font-size: 14px;
     color: #fff;
     cursor: pointer;
 }
@@ -585,16 +564,16 @@ main > section {
 }
 .footer-section .about{
     float: left;
-    margin-right: 90px;
+    margin-right: 30px;
     width: 245px;
     text-align: left;
 }
 .footer-section .about .logo{
-    margin-bottom: 32px;
+    margin-bottom: 18px;
 }
 .footer-section .about .logo img{
-    width: 156px;
-    height: 44px;
+    width: 150px;
+    /* height: 44px; */
 }
 .footer-section .about .time{
     margin-bottom: 21px;
@@ -639,6 +618,15 @@ main > section {
     background: #000;
     width: 100%;
     line-height: 100px;
+    text-align: center;
+}
+.friend-link span {
+    opacity: 0.56;
+    font-family: PingFangSC-Regular;
+    font-size: 16px;
+    color: #FFFFFF;
+    letter-spacing: 0;
+    text-align: center;
 }
 .friend-link ul{
     overflow: hidden;
@@ -1004,7 +992,7 @@ h1.navbar-brand {
     text-align: center;
     top: 0;
     width: 60%;
-    z-index: 999999;
+    z-index: 999;
     left: 50%;
     transform: translateX(-50%);
 

BIN
frontend/saas-portal-web/static/img/banner@2x@2x.png


BIN
frontend/saas-portal-web/static/img/banner@3x@2x.png


BIN
frontend/saas-portal-web/static/img/feature/blue1@2x.png


BIN
frontend/saas-portal-web/static/img/feature/blue3@2x.png


BIN
frontend/saas-portal-web/static/img/feature/illustration1@2x.png


BIN
frontend/saas-portal-web/static/img/feature/illustration2@2x.png


BIN
frontend/saas-portal-web/static/img/feature/illustration3@2x.png


BIN
frontend/saas-portal-web/static/img/feature/illustration4@2x.png


BIN
frontend/saas-portal-web/static/img/feature/yellow2@2x.png


BIN
frontend/saas-portal-web/static/img/feature/yellow4@2x.png


+ 9 - 2
frontend/saas-web/app/Application.scss

@@ -230,6 +230,10 @@ body.launching {
 .x-column-header {
   background: #E5F7FF;
   border-right: 1px solid #ABDAFF;
+
+  &:last-child {
+    border: none;
+  }
 }
 
 .x-column-header-text-inner {
@@ -305,8 +309,6 @@ body.launching {
   background-color: #ffefbb;
 }
 
-
-
 /*滚动条样式*/
 div::-webkit-scrollbar {
   width: 10px;
@@ -463,4 +465,9 @@ div::-webkit-scrollbar-track {
       background-size: 16px 16px;
       background-position: center;
   }
+}
+
+/** tab **/
+.x-tab-default.x-tab-active .x-tab-close-btn {
+  color: #34BAF6;
 }

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

@@ -280,8 +280,10 @@ Ext.define('saas.util.FormUtil', {
                     if(initData) {
                         Ext.apply(initData.main, formData.main);
                         form.setFormData(initData);
+                        form.fireEvent('load', form, initData);
                     }else {
                         form.initFormData(formData);
+                        form.fireEvent('load', form, formData);
                     }
                 }).catch(function(res) {
                     saas.util.BaseUtil.showErrorToast(res.message);

+ 21 - 0
frontend/saas-web/app/view/core/base/BasePanel.js

@@ -73,4 +73,25 @@ Ext.define('saas.view.core.base.BasePanel', {
         });
         me.callParent(arguments);
     },
+    listeners: {
+        beforerender: function(form) {
+            var items = form.dockedItems.items[0].items.items,
+            searchField = form.searchField;
+
+            Ext.Array.each(searchField, function(f) {
+                var name = f.name;
+                var field = form.getForm().findField(name);
+                field.enableKeyEvents = true;
+                field.on && field.on({
+                    keydown: {
+                        fn: function(th, e, eOpts) {
+                            if(e.keyCode == 13) {
+                                form.getController().query()
+                            }
+                        }
+                    }
+                });
+            });
+        }
+    }
 });

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

@@ -331,7 +331,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                     var d = detailData[j];
                     var o = {};
                     o[detnoColumn] = j + 1;
-                    var r = store.getAt(j) || store.add(o)[0];
+                    var r = store.add(o)[0];
                     for(var k in d) {
                         r.set(k, d[k]);
                     }

+ 46 - 16
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -410,10 +410,47 @@ Ext.define('saas.view.core.form.FormPanelController', {
         caller = form.caller,
         id = viewModel.get(form._idField);
 
-        saas.util.BaseUtil.request({
-            url: '/api/commons/jasperReport/printByDefault',
-            // url: 'http://192.168.253.58:8920/jasperReport/printByDefault',
-            method: 'POST',
+        me.beforePrint(caller).then(function(flag) {
+            if(!flag) {
+                return false;
+            }
+            saas.util.BaseUtil.request({
+                url: '/api/commons/jasperReport/printByDefault',
+                // url: 'http://192.168.253.58:8920/jasperReport/printByDefault',
+                method: 'POST',
+                headers: {
+                    "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
+                },
+                params: {
+                    caller: caller,
+                    id: id
+                }
+            }).then(function(res) {
+                var data = res.data,
+                printurl = data.printurl,
+                printtype = data.printtype,
+                reportName = data.reportName,
+                title = data.title,
+                whereCondition = data.whereCondition,
+                companyId = saas.util.BaseUtil.getCurrentUser().companyId;
+    
+                var url = printurl + '?' + 'reportName=' + reportName + '&' + 'companyId=' + companyId + '&whereCondition=' + whereCondition
+    
+                window.open(url);
+            }).catch(function(res) {
+                console.error(res.message);
+                saas.util.BaseUtil.showErrorToast('获取打印报表错误:' + res.message);
+            });
+        });
+    },
+
+    /**
+     * 判断权限
+     */
+    beforePrint: function(caller) {
+        return saas.util.BaseUtil.request({
+            url: '/api/commons/' + caller + '/print',
+            method: 'GET',
             headers: {
                 "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
             },
@@ -422,17 +459,10 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 id: id
             }
         }).then(function(res) {
-            var data = res.data,
-            printurl = data.printurl,
-            printtype = data.printtype,
-            reportName = data.reportName,
-            title = data.title,
-            whereCondition = data.whereCondition,
-            companyId = saas.util.BaseUtil.getCurrentUser().companyId;
-
-            var url = printurl + '?' + 'reportName=' + reportName + '&' + 'companyId=' + companyId + '&whereCondition=' + whereCondition
-
-            window.open(url);
+            return res.success;
+        }).catch(function(res) {
+            console.error(res.message);
+            saas.util.BaseUtil.showErrorToast('未通过权限验证:' + res.message);
         });
-    },
+    }
 });

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

@@ -125,7 +125,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         if(defaultCondition) {
                             condition.push({
                                 type: 'condition',
-                                value: defaultCondition1
+                                value: defaultCondition
                             });
                         }
                         Ext.apply(store.proxy.extraParams, {
@@ -204,7 +204,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     }
                 },  {
                     text: '导出',
-                    handler: me.onImport,
+                    handler: me.onExport,
                     bind: {
                         hidden: '{!importEnable}'
                     }
@@ -282,9 +282,11 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             }
             if(c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
-                    exportStyle: {
-                        format: 'Medium Date'
-                    },
+                    format:'Y-m-d',
+                    //只导出年月日
+                    // exportStyle: {
+                    //     format: 'Medium Date'
+                    // },
                     exportRenderer: function (value) {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
                     }
@@ -317,8 +319,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     onImport:function(me){
         console.log("导入");
     },
-    onExport: function (me) {
-        var grid = me.ownerCt.ownerCmp.ownerCt.ownerCt;
+    onExport: function () {
+        var grid = this.up('grid');
         //导出接口权限设置
         var _url = grid.baseVastUrl.substring(0,grid.baseVastUrl.length-1);
         var lastIndex = _url.lastIndexOf('/');

+ 27 - 2
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -92,6 +92,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
                             }, {
                                 text: 'Excel xml (包含分组合计)',
                                 cfg: {
+                                    type: 'excel03',
+                                    ext: 'xml',
                                     includeGroups: true,
                                     includeSummary: true
                                 }
@@ -319,6 +321,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
             if(c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
+                    // 这两个都要写上,才能控制到不同类型的导出格式,原因不明- -!
                     format: 'Y-m-d',
                     exportStyle: [{
                         type: 'csv',
@@ -326,6 +329,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     }],
                     exportRenderer: function (value) {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
+                    },
+                    // 下面这个方法不写会造成日期列求和,原因不明- -!
+                    exportSummaryRenderer: function(v) {
+                        return v;
                     }
                 })
             }else if(c.xtype == 'numbercolumn') {
@@ -336,14 +343,15 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         var xr = (new Array(arr[1].length)).fill('0');
                         var format = '0.' + xr.join();
                         return Ext.util.Format.number(v, format);
-                    }
+                    },
                 });
             }
 
             if(c.summaryType) {
+                me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
-                    operation: c.summaryType,
+                    operation: c.summaryTypeName,
                 });
             }
         })
@@ -353,6 +361,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return columns;
     },
 
+    initSummaryType: function(column) {
+        var summaryType = column.summaryType;
+        if(Ext.isString(summaryType)) {
+            column.summaryTypeName = summaryType;
+        }
+        if(summaryType == 'sum') {
+            // 原生的求和方法使用的是Store.sum,在数据存在null时计算结果为NaN,这里重写一下
+            column.summaryType = function(records, values) {
+                return Ext.Array.sum(values);
+            }
+        }
+    },
+
     initSearchItems: function() {
         var me = this,
         items = me.searchItems,
@@ -470,6 +491,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             type = 'number';
         }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield'])) {
             type = 'date';
+        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            type = 'string';
         }else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
         }else {
@@ -524,6 +547,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             to = value.to;
 
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
         }else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
         }else if(me.isContainsAny(xtypes, ['multicombo'])) {

+ 42 - 11
frontend/saas-web/app/view/core/report/ReportPanel.scss

@@ -1,3 +1,5 @@
+$border-color: #999;
+
 .x-report-panel {
     
     .x-report-grid {
@@ -5,14 +7,14 @@
         .x-panel-bodyWrap {
 
             .x-panel-default-outer-border-trl {
-                border-color: #999 !important;
+                border-color: $border-color !important;
             }
 
             .x-grid-header-ct {
-                border-color: #999 !important;
+                border-color: $border-color !important;
 
                 .x-column-header {
-                    border-color: #999 !important;
+                    border-color: $border-color !important;
 
                     .x-column-header-text-inner {
                         font-weight: bold;
@@ -21,25 +23,54 @@
             }
 
             .x-grid-body {
-                border-color: #999 !important;
+                border-color: $border-color !important;
                 border-width: 1px;
-                
-                .x-grid-cell-inner {
-                    border-right: 1px solid #999;
-                    border-bottom: 1px solid #999;
+
+                .x-grid-row {
+                    .x-grid-cell-inner {
+                        border-right: 1px solid $border-color;
+                        border-bottom: 1px solid $border-color;
+                    }
+
+                    .x-grid-cell {
+                        &:last-child {
+                            .x-grid-cell-inner {
+                                border-right: none;
+                            }
+                        }
+                    }
+                }
+
+                .x-grid-item {
+                    &:first-child {
+                        .x-grid-group-hd {
+                            border-top: none;
+                        }
+                    }
                 }
             }
 
             .x-toolbar-docked-bottom {
-                border-color: #999 !important;
+                border-color: $border-color !important;
                 border-width: 1px !important;
             }
             .x-panel-default-outer-border-rl {
-                border-right-color: #999 !important;
+                border-right-color: $border-color !important;
                 border-right-width: 1px !important;
-                border-left-color:  #999 !important;
+                border-left-color:  $border-color !important;
                 border-left-width: 1px !important;
             }
         }
+
+        .x-grid-group-hd {
+            border-top: 1px solid $border-color;
+            border-bottom: 1px solid $border-color;
+        }
+
+        .x-grid-row-summary {
+            .x-grid-cell {
+                border-top: none;
+            }
+        }
     }
 }

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

@@ -158,7 +158,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
         fieldLabel : "业务员", 
-        editable:false,
         allowBlank : false, 
         columnWidth : 0.25
     },{

+ 11 - 4
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -183,7 +183,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'datefield',
                 name:'bk_date',
                 fieldLabel:'建账日期',
-                format:'Y-m-d H:i:s',
+                format:'Y-m-d',
                 listeners:{
                     beforerender:function(d){
                         d.setValue(new Date())
@@ -631,12 +631,19 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         Ext.Array.each(names,function(name) {
             if(name){
                 var dataField = form.down('[name='+name+']');
-                if(dataField&&dataField.value){
-                    params[name] = dataField.value;
-                    params._value = dataField.value;
+                if(dataField){
+                    var value = dataField.getValue();
+    
+                    if(Ext.isDate(value)) {
+                        value = Ext.Date.format(value, 'Y-m-d H:i:s');
+                    }
+
+                    params[name] = value;
+                    params._value = value;
                 }
             }
         });
+
         var idField = form.down('[name='+belong.keyField+']');
         params[belong.keyField] = idField.value || 0;
         //保存接口

+ 9 - 0
frontend/saas-web/app/view/document/product/FormController.js

@@ -146,6 +146,15 @@ Ext.define('saas.view.document.product.FormController', {
             saas.util.BaseUtil.showErrorToast('禁用失败: ' + res.message);
         });
     },
+
+    qcsz_change: function(field, value) {
+        var me = this,
+        form = me.getView(),
+        detailGrid = form.down('detailGridField');
+        form.getForm().findField('qcsz').resetOriginalValue();
+        detailGrid.setHidden(!value);
+    },
+
     amount_change:function() {
         var me = this,
         viewModel = me.getViewModel(),

+ 2 - 12
frontend/saas-web/app/view/document/product/FormModel.js

@@ -3,7 +3,8 @@ Ext.define('saas.view.document.product.FormModel', {
     alias: 'viewmodel.document-product-formpanel',
 
     data: {
-        id: 0
+        id: 0,
+        qcsz: true,
     },
 
     formulas:{
@@ -13,17 +14,6 @@ Ext.define('saas.view.document.product.FormModel', {
                 return value;
             }
         },
-        qcsz_change: {
-            bind: '{qcsz}',
-            get: function(v) {
-                var form = this.getView(),
-                detailGrid = form.down('detailGridField');
-                //detailGrid.allowEmpty = !v;
-                //form.isValid();
-                form.getForm().findField('qcsz').resetOriginalValue();
-                detailGrid.setHidden(!v);
-            }
-        },
         
         /* ,
         pd_num_change: {

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

@@ -212,13 +212,16 @@ Ext.define('saas.view.document.product.FormPanel', {
         fieldLabel: '期初设置',
         name: 'qcsz',
         ignore: true,
+        listeners: {
+            change: 'qcsz_change'
+        }
     }, {
         xtype : "detailGridField", 
         storeModel:'saas.model.document.ProductDetail',
         detnoColumn: 'pd_detno',
         showCount: false,
         allowEmpty:true,
-        hidden: true,
+        // hidden: true,
         deleteDetailUrl:'/api/document/product/deleteDetail',
         columns : [{
             text : "ID", 

+ 1 - 1
frontend/saas-web/app/view/home/charts/PurchaseTrend.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.home.charts.PurchaseTrend', {
     id: 'purchase_trend',
 
     bind: {
-        title: '近六月采购趋势图'
+        title: '近六月采购趋势图(万元)'
     },
 
     initComponent: function() {

+ 1 - 1
frontend/saas-web/app/view/home/charts/SaleTrend.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
     id: 'sale_trend',
 
     bind: {
-        title: '近六月销售趋势图'
+        title: '近六月销售趋势图(万元)'
     },
 
     initComponent: function() {

+ 1 - 1
frontend/saas-web/app/view/home/charts/StockAmount.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.home.charts.StockAmount', {
     id: 'stock_amount',
 
     bind: {
-        title: '近六月库存金额图'
+        title: '近六月库存金额图(万元)'
     },
 
     initComponent: function() {

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

@@ -85,6 +85,7 @@ Ext.define('saas.view.main.Main', {
                             }
                         },{
                             text: '用户手册',
+                            hidden:true,
                             //fa-address-book-o sa-userBook
                             iconCls:'x-fa sa-navicon  fa-address-book-o',
                             handler:function(){

+ 2 - 2
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -59,7 +59,7 @@ Ext.define('saas.view.money.report.PayDetail', {
             xtype: 'numbercolumn',
             dataIndex: 've_beginapamount',
             xtype: 'numbercolumn',
-            width: 110,
+            width: 180,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -78,7 +78,7 @@ Ext.define('saas.view.money.report.PayDetail', {
             xtype: 'numbercolumn',
             dataIndex: 'pb_pdamount',
             xtype: 'numbercolumn',
-            width: 110,
+            width: 180,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

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

@@ -82,7 +82,7 @@ Ext.define('saas.view.money.report.RecDetail', {
             xtype: 'numbercolumn',
             dataIndex:'rb_rdamount',
             xtype: 'numbercolumn',
-            width: 110,
+            width: 180,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

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

@@ -99,7 +99,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '客户编号',
             dataIndex: 'sa_custcode',
-            width: 0
+            hidden :true
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
@@ -132,7 +132,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '录入人',
             dataIndex: 'creatorName',
-            width: 0
+            hidden :true
         }, {
             text: '审核人',
             dataIndex: 'sa_auditman',
@@ -140,7 +140,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '收货地址',
             dataIndex: 'sa_toplace',
-            width: 0
+            hidden :true
         }, {
             text: '备注',
             dataIndex: 'sa_remark',

+ 1 - 1
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -124,7 +124,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         },{
             text: '单据类型',
             dataIndex: 'pi_class',
-            width: 0
+            hidden :true
         }],
         relativeColumn: [{
             text: 'id',

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

@@ -159,7 +159,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             }, {
                 text : "仓库ID", 
                 dataIndex : "pd_whid", 
-                width : 0
+                hidden :true
             }, {
                 text : "仓库", 
                 dataIndex : "pd_whcode", 

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

@@ -121,11 +121,11 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             text: '未含税金额',
             dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
-            width: 0
+            hidden :true
         },{
             text: '单据类型',
             dataIndex: 'pi_class',
-            width: 0
+            hidden :true
         }],
         relativeColumn: [{
             text: 'id',

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

@@ -19,10 +19,10 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         emptyText:'请输入单号或物料',
         showDetail: true,
         getCondition: function(value) {
-            if(value != '') {
-                return  ' (pi_inoutno like\'%' + value + '%\' or pd_prodcode like \'%'+value+'%\' ) ';
-            }else {
+            if(value == ''|| value ==null) {
                 return '1=1';
+            }else {
+                return  ' (pi_inoutno like\'%' + value + '%\' or pd_prodcode like \'%'+value+'%\' ) ';
             }
         }
     }, {
@@ -66,10 +66,10 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         emptyText :'请输入仓库名或仓库编号',
         showDetail: true,
         getCondition: function(value) {
-            if(value != '') {
-                return  ' (pd_whcode like\'%' + value + '%\' or pd_whname like \'%'+value+'%\' or pd_inwhcode like\'%' + value + '%\' or pd_inwhname like \'%'+value+'%\') ';
-            }else {
+            if(value == '' || value == null) {
                 return '1=1';
+            }else {
+                return  ' (pd_whcode like\'%' + value + '%\' or pd_whname like \'%'+value+'%\' or pd_inwhcode like\'%' + value + '%\' or pd_inwhname like \'%'+value+'%\') ';                
             }
         }
     }],
@@ -167,7 +167,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
                 width: 80
             },{
                 text: '数量',
-                dataIndex: 'pd_inqty',
+                dataIndex: 'pd_outqty',
                 xtype:'numbercolumn',
                 width: 110
             },{

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

@@ -197,7 +197,8 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         text : "盘点库存", 
         dataIndex : "st_actqty", 
         width : 110.0, 
-        xtype : "numbercolumn",
+        // xtype : "numbercolumn",
+        align: 'right',
         editor : {
             xtype : "numberfield",
             decimalPrecision: 3,
@@ -224,7 +225,8 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         text : "盘盈盘亏", 
         dataIndex : "st_num", 
         width : 110.0, 
-        xtype : "numbercolumn",
+        // xtype : "numbercolumn",
+        aligin: 'right',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');

+ 26 - 1
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -385,5 +385,30 @@ Ext.define('saas.view.stock.make.FormPanel', {
         name : "ma_auditdate", 
         fieldLabel : "审核日期",
         readOnly:true
-    }]
+    }],
+    beforeAudit:function(){
+        var me = this,
+        controller = me.getController(),
+        viewModel = me.getViewModel(),
+        grid = me.down('detailGridField'),
+        data = grid.getTrueData()
+        str='';
+        Ext.Array.each(data,function(item){
+            if(item.mm_price==0){     
+                str=str+item.mm_detno+'行'+item.mm_prodcode+'物料成本单价为0!'+'<br>'
+            }
+        });
+    
+        if(str!=''){
+            saas.util.BaseUtil.showConfirm('提示',str)
+            .then(function(y) {
+                if(y == 'yes') {
+                    controller.audit();
+                }
+            });
+        }else{
+            controller.audit();
+        }
+        return false;
+    }
 });

+ 45 - 1
frontend/saas-web/app/view/viewport/ViewportController.js

@@ -73,7 +73,13 @@ Ext.define('saas.view.viewport.ViewportController', {
             // There is no authenticated user, let's redirect to the login page but keep track
             // of the original route to restore the requested route after user authentication.
             me.originalRoute = route;
-            me.redirectTo('login', {replace: true});
+            //没有session时  判断cookie中的uid
+            var hasValidCookie = Ext.util.Cookies.get('uid')?me.getAccountCookie():false;
+            if(!hasValidCookie){
+                me.redirectTo('login', {replace: true});
+            }else{
+                me.redirectTo('main', {replace: true});
+            }
             return;
         }
 
@@ -85,6 +91,44 @@ Ext.define('saas.view.viewport.ViewportController', {
         }
     },
 
+    getAccountCookie:function(){
+        var hasValidCookie = false;
+        Ext.Ajax.request({
+            url: 'http://192.168.253.31:8560/api/auth/info',
+            withCredentials: true,
+            async:false,
+            dataType: 'json',
+            headers:{
+                'Authorization':'',
+                'Access-Control-Allow-Origin': '<origin> | *'
+            },
+            method: 'GET',
+            success: function(response, opts) {
+                var res = Ext.decode(response.responseText);
+                var data = res.data;
+                var token = data.token;
+                data.expire = token.expire;
+                data.timestamp = token.timestamp;
+                data.token = token.token;
+                delete data['token'];
+                if(data.conpanyId){
+                    session = data? saas.model.Session.loadData(data) : null;
+                    if (session && session.isValid()) {
+                        me.setRequestToken(session.get('token'));
+                        me.saveSession(session);
+                    }
+                    hasValidCookie = true
+                }else{
+                    window.location.href = Ext.manifest.server.accountCenter
+                }
+            },
+            failure: function(response, opts) {
+                showErrorToast('解析cookie失败:'+response.message)
+            }
+        });
+        return hasValidCookie;
+    },
+
     setRequestToken: function(token) {
         var headers = Ext.Ajax.getDefaultHeaders() || {};
         if (token) {