Browse Source

Merge remote-tracking branch 'origin/dev' into dev

zhoudw 8 years ago
parent
commit
ff6c68cdea
50 changed files with 960 additions and 154 deletions
  1. 12 0
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/CommonService.java
  2. 14 3
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  3. 1 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/CommonMapper.java
  4. 1 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/CommonService.java
  5. 40 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java
  6. 5 0
      applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml
  7. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/SubledgerMapper.java
  8. 9 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  9. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  10. 85 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  11. 14 0
      applications/document/document-server/src/main/resources/mapper/SubledgerMapper.xml
  12. 0 3
      applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml
  13. 0 3
      applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml
  14. 6 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java
  15. 5 9
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  16. 2 7
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleReportServiceImpl.java
  17. 9 9
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  18. 3 0
      applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml
  19. 3 0
      frontend/saas-web/app/view/core/base/BasePanel.js
  20. 33 0
      frontend/saas-web/app/view/core/base/BasePanel.scss
  21. 13 0
      frontend/saas-web/app/view/core/base/GridPanel.js
  22. 1 1
      frontend/saas-web/app/view/core/chart/ChartBase.js
  23. 39 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  24. 25 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  25. 1 1
      frontend/saas-web/app/view/document/kind/ChildForm.js
  26. 1 1
      frontend/saas-web/app/view/home/HomeModel.js
  27. 20 8
      frontend/saas-web/app/view/home/charts/MonthIO.js
  28. 28 11
      frontend/saas-web/app/view/home/charts/MonthPurchase.js
  29. 9 1
      frontend/saas-web/app/view/home/charts/MonthSale.js
  30. 24 3
      frontend/saas-web/app/view/home/charts/PurchaseTrend.js
  31. 22 1
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  32. 24 3
      frontend/saas-web/app/view/home/charts/StockAmount.js
  33. 7 2
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  34. 6 2
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  35. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  36. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  37. 0 24
      frontend/saas-web/app/view/sys/account/AccountInformation.js
  38. 358 0
      frontend/saas-web/app/view/sys/account/DataList.js
  39. 10 0
      frontend/saas-web/app/view/sys/account/DataListController.js
  40. 4 0
      frontend/saas-web/app/view/sys/account/DataListlModel.js
  41. 12 12
      frontend/saas-web/app/view/sys/config/FormPanel.js
  42. 12 0
      frontend/saas-web/app/view/sys/finish/DataList.js
  43. 10 5
      frontend/saas-web/app/view/sys/manager/FormPanel.js
  44. 48 0
      frontend/saas-web/app/view/sys/manager/FormPanel.scss
  45. 9 0
      frontend/saas-web/app/view/sys/maxnumbers/DataList.js
  46. 12 0
      frontend/saas-web/app/view/sys/messagelog/DataList.js
  47. 0 2
      frontend/saas-web/app/view/sys/power/FormPanel.js
  48. 13 19
      frontend/saas-web/app/view/sys/power/GroupGrid.js
  49. 0 1
      frontend/saas-web/app/view/sys/power/TreePanel.js
  50. 1 11
      frontend/saas-web/resources/json/navigation.json

+ 12 - 0
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/CommonService.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.commons.api;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+@FeignClient("commons-server")
+public interface CommonService {
+
+    @PostMapping("/action/audit")
+    public String commonAudit(@RequestParam String table, @RequestParam String keyvalue, @RequestParam String status,
+                                      @RequestParam String statuscode, @RequestParam String auditdate, @RequestParam String auditman);
+}

+ 14 - 3
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -3,9 +3,10 @@ package com.usoftchina.saas.commons.controller;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.service.CommonService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.async.DeferredResult;
+
+import java.util.concurrent.CompletableFuture;
 
 @RestController
 public class CommonController {
@@ -23,4 +24,14 @@ public class CommonController {
         return Result.success(commonService.initCheck());
     }
 
+    @PostMapping("/action/audit")
+    public DeferredResult commonAudit(@RequestParam String table, @RequestParam String keyvalue, @RequestParam String status,
+                              @RequestParam String statuscode, @RequestParam String auditdate, @RequestParam String auditman) {
+
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> commonService.commonAudit(table, keyvalue, status, statuscode, auditdate, auditman))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
+    }
+
 }

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

@@ -14,4 +14,5 @@ public interface CommonMapper {
 
     int getCountVendor(@Param("companyId") Long companyId);
 
+    void commonAudit(String sql);
 }

+ 1 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/CommonService.java

@@ -10,4 +10,5 @@ public interface CommonService {
      */
     InitStatusDTO initCheck();
 
+    String commonAudit(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman);
 }

+ 40 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java

@@ -2,11 +2,16 @@ package com.usoftchina.saas.commons.service.impl;
 
 import com.usoftchina.saas.commons.dto.InitStatusDTO;
 import com.usoftchina.saas.commons.mapper.CommonMapper;
+import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.commons.service.CommonService;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.utils.DateUtils;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+
 @Service
 public class CommonServiceImpl implements CommonService {
 
@@ -43,4 +48,39 @@ public class CommonServiceImpl implements CommonService {
         }
         return result;
     }
+
+    @Override
+    public String commonAudit(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(table) || StringUtils.isEmpty(keyvalue)) {
+            return null;
+        }
+        String sql = praseSql(table, keyvalue, status, statuscode, auditdate, auditman, companyId);
+        if (null != sql) {
+            commonMapper.commonAudit(sql);
+        }
+        return "success";
+    }
+
+    private String praseSql(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman, Long companyId) {
+        String sql = "update " + table + " set ";
+        StringBuilder sb = new StringBuilder();
+        if (!StringUtils.isEmpty(status)) {
+            sb.append(" " + status + " = '" + Status.AUDITED.getDisplay() + "',");
+        }
+        if (!StringUtils.isEmpty(statuscode)) {
+            sb.append(" " + statuscode + "='" + Status.AUDITED.name() + "',");
+        }
+        if (!StringUtils.isEmpty(auditdate)) {
+            sb.append(" " + auditdate + "='" + DateUtils.format(new Date(), "yyyy-MM-dd") + "',");
+        }
+        if (!StringUtils.isEmpty(auditman)) {
+            sb.append(" " + auditman + "='" + BaseContextHolder.getUserName() + "',");
+        }
+        if (sb.length() > 0) {
+            sql =  sql + sb.substring(0, sb.length() - 1) + " where " + keyvalue + " and companyId=" + companyId;
+            return sql;
+        }
+        return null;
+    }
 }

+ 5 - 0
applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml

@@ -13,7 +13,12 @@
     <select id="getCountCustomer" resultType="int">
         SELECT COUNT(*) FROM CUSTOMER WHERE COMPANYID=#{companyId} AND CU_STATUSCODE = 'OPEN'
     </select>
+
     <select id="getCountVendor" resultType="int">
         SELECT COUNT(*) FROM VENDOR WHERE COMPANYID=#{companyId} AND VE_STATUSCODE = 'OPEN'
     </select>
+
+    <update id="commonAudit" parameterType="string">
+      ${value}
+    </update>
 </mapper>

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

@@ -28,6 +28,12 @@ public interface SubledgerMapper {
     Subledger selectByKindCodeCustid(@Param("sl_code") String sl_code, @Param("sl_kind") String sl_kind,
                                      @Param("sl_custid") Integer sl_custid);
 
+    Subledger selectByKindCodeVendid(@Param("sl_code") String sl_code, @Param("sl_kind") String sl_kind,
+                                     @Param("sl_vendid") Integer sl_vendid);
+
     void deleteCustomer(@Param("sl_code") String sl_code, @Param("sl_kind") String sl_kind,
                         @Param("sl_custid") Integer sl_custid);
+
+    void deleteVendor(@Param("sl_code") String sl_code, @Param("sl_kind") String sl_kind,
+                        @Param("sl_vendid") Integer sl_vendid);
 }

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

@@ -191,14 +191,6 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             customer.setCu_beginprerecamount(cutpl.getCu_beginprerecamount());
         }
 
-        //更新应收余额
-        Customer customer1 = getMapper().selectByPrimaryKey(cu_id);
-        Double cu_leftamount = (customer1.getCu_beginaramount() == null ? new Double(0) :  customer1.getCu_beginaramount())-
-                (customer1.getCu_beginprerecamount() == null ? new Double(0) : customer1.getCu_beginprerecamount()) +
-                (customer1.getCu_recamount() == null ? new Double(0) : customer1.getCu_recamount()) -
-                (customer1.getCu_preamount() == null ? new Double(0) : customer1.getCu_preamount());
-        customer.setCu_leftamount(cu_leftamount);
-
         //更新操作
         getMapper().updateByPrimaryKeySelective(customer);
         //添加从表传输对象
@@ -245,6 +237,15 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             customeraddressMapper.batchUpdate(updateDetail2);
         }
 
+        //更新应收余额
+        Customer customer1 = getMapper().selectByPrimaryKey(cu_id);
+        Double cu_leftamount = (customer1.getCu_beginaramount() == null ? new Double(0) :  customer1.getCu_beginaramount())-
+                (customer1.getCu_beginprerecamount() == null ? new Double(0) : customer1.getCu_beginprerecamount()) +
+                (customer1.getCu_recamount() == null ? new Double(0) : customer1.getCu_recamount()) -
+                (customer1.getCu_preamount() == null ? new Double(0) : customer1.getCu_preamount());
+        customer.setCu_leftamount(cu_leftamount);
+        getMapper().updateByPrimaryKeySelective(customer);
+
         //插入中间表
         Double amount = (customer.getCu_beginaramount() == null ? new Double(0) : customer.getCu_beginaramount())
                 - (customer.getCu_beginprerecamount() == null ? new Double(0) : customer.getCu_beginprerecamount());

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

@@ -526,7 +526,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
      * @Author: chenwei
      * @Date: 2018/10/26
      */
-    private String pushMaxnubmer(String code, Long id) {
+    private synchronized String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }

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

@@ -14,9 +14,11 @@ import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorListDTO;
+import com.usoftchina.saas.document.entities.Subledger;
 import com.usoftchina.saas.document.entities.Vendor;
 import com.usoftchina.saas.document.entities.VendorList;
 import com.usoftchina.saas.document.entities.Vendorcontact;
+import com.usoftchina.saas.document.mapper.SubledgerMapper;
 import com.usoftchina.saas.document.mapper.VendorMapper;
 import com.usoftchina.saas.document.mapper.VendorcontactMapper;
 import com.usoftchina.saas.document.service.VendorService;
@@ -26,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -43,6 +46,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
     private MessageLogService messageLogService;
     @Autowired
     private MaxnumberService maxnumberService;
+    @Autowired
+    private SubledgerMapper subledgerMapper;
 
     @Override
     public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -197,6 +202,51 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             //记录LOG
             messageLogService.update(generateMsgObj(main.getId(), code));
         }
+
+        //更新应收款余额
+        Double ve_leftamount = (main.getVe_beginapamount() == null ? new Double(0) : main.getVe_beginapamount())
+                - (main.getVe_beginprepayamount() == null ? new Double(0) : main.getVe_beginprepayamount())
+                + (main.getVe_payamount() == null ? new Double(0) : main.getVe_payamount())
+                - (main.getVe_preamount() == null ? new Double(0) : main.getVe_preamount());
+        main.setVe_leftamount(ve_leftamount);
+        getMapper().updateByPrimaryKeySelective(main);
+
+        //插入中间表
+        Double amount = (main.getVe_beginapamount() == null ? new Double(0) : main.getVe_beginapamount())
+                - (main.getVe_beginprepayamount() == null ? new Double(0) : main.getVe_beginprepayamount());
+        if (amount != new Double(0)){
+            Subledger subledger = new Subledger();
+            subledger.setSl_code("期初余额");
+            subledger.setSl_kind("期初余额");
+            subledger.setSl_vendid(Math.toIntExact(main.getId()));
+            subledger.setSl_custid(0);
+            subledger.setCompanyId(BaseContextHolder.getCompanyId());
+            String dates = date2String(main.getVe_begindate(), "yyyy-mm");
+            dates = dates + "-01";
+            Date date = null;
+            try {
+                date = string2Date(dates, "yyyy-mm-dd");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            subledger.setSl_date(date);
+            if (amount > new Double(0)){
+                subledger.setSl_amount(amount);
+            }else {
+                subledger.setSl_preamount(amount);
+            }
+            subledger.setSl_orderamount(Math.abs(amount));
+            subledger.setSl_namount(amount);
+
+            Subledger subledger1 = subledgerMapper.selectByKindCodeVendid("期初余额","期初余额",
+                    Math.toIntExact(main.getId()));
+            if (subledger1 == null) {
+                subledgerMapper.insertSelective(subledger);
+            }else {
+                subledgerMapper.updateByPrimaryKeySelective(subledger);
+            }
+        }
+
         return generateMsgObj(main.getId(), code);
     }
 
@@ -210,6 +260,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             getMapper().deleteByPrimaryKey(id);
             vendorcontactMapper.deleteByFK(id);
             String code = getMapper().getCodeById(id, BaseContextHolder.getCompanyId());
+
+            //删除中间表
+            subledgerMapper.deleteVendor("期初余额", "期初余额", Math.toIntExact(id));
             //记录LOG
             messageLogService.delete(generateMsgObj(id, code));
         }
@@ -355,4 +408,36 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
         return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
     }
+
+    /**
+     * String转Date类型
+     *
+     * @param dateStr
+     *            时间字符串
+     * @return Date类型时间
+     * @throws Exception
+     *             异常
+     */
+    public static Date string2Date(String dateStr, String format) throws Exception {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (dateStr == null) {
+            return sdf.parse(dateStr);
+        }
+        return null;
+    }
+
+    /**
+     * Date转String
+     *
+     * @param date
+     *            Date类型时间
+     * @return 时间字符串
+     */
+    public static String date2String(Date date, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (date != null) {
+            return sdf.format(date);
+        }
+        return null;
+    }
 }

+ 14 - 0
applications/document/document-server/src/main/resources/mapper/SubledgerMapper.xml

@@ -255,9 +255,23 @@
     sl_custid = #{sl_custid,jdbcType=INTEGER}
   </select>
 
+  <select id="selectByKindCodeVendid" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from subledger
+    where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind,jdbcType=VARCHAR} and
+    sl_vendid = #{sl_vendid,jdbcType=INTEGER}
+  </select>
+
   <delete id="deleteCustomer">
     delete from subledger
     where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind, jdbcType=VARCHAR} and
     sl_custid = #{sl_custid,jdbcType=INTEGER}
   </delete>
+
+  <delete id="deleteVendor">
+    delete from subledger
+    where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind, jdbcType=VARCHAR} and
+    sl_vendid = #{sl_vendid,jdbcType=INTEGER}
+  </delete>
 </mapper>

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

@@ -236,9 +236,6 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Recbalancedet">
     update recbalancedet
     <set>
-      <if test="id != null">
-        rd_rbid = #{id,jdbcType=INTEGER},
-      </if>
       <if test="rd_detno != null">
         rd_detno = #{rd_detno,jdbcType=INTEGER},
       </if>

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

@@ -183,9 +183,6 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Recbalancedetail" >
     update recbalancedetail
     <set >
-      <if test="id != null" >
-        rbd_rbid = #{id,jdbcType=INTEGER},
-      </if>
       <if test="rbd_detno != null" >
         rbd_detno = #{rbd_detno,jdbcType=INTEGER},
       </if>

+ 6 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java

@@ -49,5 +49,11 @@ public class SaleProfitView {
 
     private Double pd_profit;
 
+    private Double pd_price;
+
+    private Double pd_netprice;
+
+    private String pd_remark;
+
     private Double pd_profitpresent;
 }

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

@@ -17,6 +17,7 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.sale.dto.ProdIODetailDTO;
 import com.usoftchina.saas.sale.dto.ProdInOutDTO;
@@ -230,7 +231,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    @Transactional
     public DocBaseDTO audit(ProdInOutFormDTO formData) {
         Long id = null;
         DocBaseDTO baseDTO = new DocBaseDTO();
@@ -246,7 +246,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         baseDTO.setCode(formData.getMain().getPi_inoutno());
         return baseDTO;
     }
-    private void singleAudit(ProdInOutDTO prodInOutDTO) {
+
+    @Transactional
+    public void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
         String pi_inoutno = prodInOutDTO.getPi_inoutno();
         String pi_statuscode = prodInOutDTO.getPi_statuscode();
@@ -344,13 +346,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    public PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req) {
-        //设置默认分页
-        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
-            page = new PageRequest();
-            page.setNumber(1);
-            page.setSize(10);
-        }
+    public PageInfo<ProdInOutList> getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         //查询数据
         List<ProdInOutList> lists = getListByMode(req);

+ 2 - 7
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleReportServiceImpl.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.sale.mapper.SaleProfitViewMapper;
 import com.usoftchina.saas.sale.mapper.SalerecViewMapper;
@@ -35,13 +36,7 @@ public class SaleReportServiceImpl implements SaleReportService{
         return getListDATA(page, req, "SaleRec");
     }
 
-    private PageInfo getListDATA(PageRequest page, ListReqDTO req, String type) {
-        //设置默认分页
-        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
-            page = new PageRequest();
-            page.setNumber(1);
-            page.setSize(10);
-        }
+    private PageInfo getListDATA(@PageDefault(size = 10) PageRequest page, ListReqDTO req, String type) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         //查询数据
         List lists = getListByType(req, type);

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
@@ -13,6 +14,7 @@ import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.sale.dto.SaleDTO;
 import com.usoftchina.saas.sale.dto.SaleDetailDTO;
@@ -56,15 +58,11 @@ public class SaleServiceImpl implements SaleService{
     private ProdIODetailMapper prodIODetailMapper;
     @Autowired
     private ProdInOutService prodInOutService;
+    @Autowired
+    private CommonService commonService;
 
     @Override
-    public PageInfo<SaleList> getListData(PageRequest page, ListReqDTO req) {
-        //设置默认分页
-        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
-            page = new PageRequest();
-            page.setNumber(1);
-            page.setSize(10);
-        }
+    public PageInfo<SaleList> getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         //查询数据
         List<SaleList> lists = getListByMode(req);
@@ -232,7 +230,7 @@ public class SaleServiceImpl implements SaleService{
     }
 
     private void singleAudit(Long id) {
-        Sale sale = new Sale();
+        /*Sale sale = new Sale();
         //生成更新对象
         sale.setId(id);
         sale.setSa_status(Status.AUDITED.getDisplay());
@@ -242,7 +240,9 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_auditman("TESTADMIN");
         sale.setSa_auditdate(new Date());
         //更新存在字段
-        saleMapper.updateByPrimaryKeySelective(sale);
+        saleMapper.updateByPrimaryKeySelective(sale);*/
+        commonService.commonAudit("sale", "sa_id=" + id, "sa_status",
+                "sa_statuscode", "sa_auditdate", "sa_auditman");
         //更新销售金额
         updateTotal(id);
         //更新从表总额

+ 3 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml

@@ -20,8 +20,11 @@
     <result column="pd_ordertotal" property="pd_ordertotal" jdbcType="DOUBLE" />
     <result column="pd_total" property="pd_total" jdbcType="DOUBLE" />
     <result column="pd_profit" property="pd_profit" jdbcType="DOUBLE" />
+    <result column="pd_price" property="pd_price" jdbcType="DOUBLE" />
+    <result column="pd_netprice" property="pd_netprice" jdbcType="DOUBLE" />
     <result column="pd_profitpresent" property="pd_profitpresent" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
+      <result column="pd_remark" property="pd_remark" jdbcType="VARCHAR" />
   </resultMap>
   <select id="selectByCondition" resultMap="BaseResultMap">
     select  *  from Sale_Profit_View

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

@@ -5,11 +5,13 @@ Ext.define('saas.view.core.base.BasePanel', {
     controller: 'core-base-basepanel',
     viewModel: 'core-base-basepanel',
 
+    cls:'core-base-basepanel',
     //工具类
     FormUtil: Ext.create('saas.util.FormUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
 
     //基础属性
+    frame:false,
     autoScroll: true,
     border: 1,
     bodyPadding: 5,
@@ -38,6 +40,7 @@ Ext.define('saas.view.core.base.BasePanel', {
 
         Ext.apply(me, {
             dockedItems: [{
+                frame:false,
                 xtype: 'toolbar',
                 dock: 'top',
                 style: {

+ 33 - 0
frontend/saas-web/app/view/core/base/BasePanel.scss

@@ -0,0 +1,33 @@
+.core-base-basepanel{
+    .x-panel-default-outer-border-trl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+    }
+    .x-panel-default-outer-border-rbl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+        border-bottom-color: #fff !important;
+        border-bottom-width: 1px !important;
+    }
+}
+.core-base-gridpanel{
+    .x-grid-body{
+        border:1px solid #abdaff !important;
+        border-top-width: 0 !important;
+    }
+    .x-grid-header-ct{
+        border:1px solid #abdaff !important;
+    }
+}
+.x-basepanel-pagingtoolbar{
+    border:1px solid #abdaff !important;
+    border-top-width: 0 !important;
+}

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

@@ -8,6 +8,8 @@ Ext.define('saas.view.core.base.GridPanel', {
         mode : "MULTI" ,
         ignoreRightMouseSelection : false
     },
+
+    cls:'core-base-gridpanel',
     
     dataUrl: '',
     dbSearchFields: [],
@@ -15,6 +17,7 @@ Ext.define('saas.view.core.base.GridPanel', {
 
     initComponent: function() {
         var me = this;
+        me.frame = false;
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
             me.columns = me.insertFirstColumn(me.columns);
@@ -129,6 +132,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                 },{
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
+                    cls:'x-basepanel-pagingtoolbar',
                     displayInfo: true,
                     store: me.store
                 }]
@@ -171,6 +175,15 @@ Ext.define('saas.view.core.base.GridPanel', {
     },
 
     listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
         itemClick: function(view,record,a,index,c) {
             var classList = c.target.classList.value;
             var form = view.ownerCt.ownerCt;

+ 1 - 1
frontend/saas-web/app/view/core/chart/ChartBase.js

@@ -6,11 +6,11 @@ Ext.define('saas.view.core.chart.ChartBase', {
     ],
 
     height: 300,
+    bodyPadding: 5,
 
     layout: 'fit',
 
     cls: 'quick-graph-panel shadow',
-    // headerPosition: 'bottom',
 
     defaults: {
         width: '100%'

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

@@ -443,7 +443,45 @@ Ext.define('saas.view.core.form.FormPanel', {
     },
 
     getDirtyData: function() {
-        return this.getForm().getDirtyData();
+        var me = this,
+        viewModel = me.getViewModel(),
+        allData = viewModel.getData(),
+        bindFields = allData.base.bindFields,
+        detailCount = me.detailCount,
+        formData = {},
+        detailGrids = me.query('detailGridField');
+
+        Ext.Array.each(bindFields, function(field) {
+            var v = allData[field];
+            if(Ext.isDate(v)) {
+                v = Ext.Date.format(v, 'Y-m-d H:i:s');
+            }
+            formData[field] = v;
+        });
+
+        var dirtyData = {
+            main: formData,
+        };
+
+        for (var i = 0; i < detailCount; i++) {
+            var g = detailGrids[i];
+            var gridDirtyData = g.getDirtyData();
+            var modelDetail = allData['detail' + i];
+            var detailBindFields = modelDetail.detailBindFields;
+
+            Ext.Array.each(gridDirtyData, function(d) {
+                for(k in d) {
+                    if(!Ext.Array.contains(detailBindFields, k)) {
+                        delete d[k];
+                    }
+                }
+            });
+            
+
+            dirtyData['detail' + i] = gridDirtyData;
+        }
+
+        return dirtyData;
     },
 
     beforeSave: function() {

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

@@ -451,6 +451,31 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         return allData;
     },
 
+    getDirtyData: function() {
+        var me = this,
+        store = me.getStore(),
+        allData = store.getData().items,
+        dirtyData = [];
+
+        Ext.Array.each(allData, function(item){
+            var d = Object.assign({}, item.data),
+            dirty = item.dirty;
+
+            if(dirty){
+                if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
+                    d.id = 0;
+                }
+                for(k in d) {
+                    if(Ext.isDate(d[k])) {
+                        d[k] = Ext.Date.format(d[k], 'Y-m-d H:i:s');
+                    }
+                }
+                dirtyData.push(d);
+            }
+        });
+        return dirtyData;
+    },
+
     /**
      * 获得有效数据
      */

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

@@ -260,7 +260,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
             },{
                 readOnly:true,
                 xtype:'textfield',
-                fieldLabel: '状态',
+                fieldLabel: '仓库状态',
                 name: 'wh_status',   
                 value:'已开启',
                 maxLength: 20

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

@@ -143,7 +143,7 @@ Ext.define('saas.view.home.HomeModel', {
                         if(r.get('x') == '收入') {
                             Ext.getCmp('home').getViewModel().set('month_in', sum);
                         }else if(r.get('x') == '支出') {
-                            Ext.getCmp('home').getViewModel().set('month_in', sum);
+                            Ext.getCmp('home').getViewModel().set('month_out', sum);
                         }
                     });
                 }

+ 20 - 8
frontend/saas-web/app/view/home/charts/MonthIO.js

@@ -37,17 +37,27 @@ Ext.define('saas.view.home.charts.MonthIO', {
                     position: 'left',
                     adjustByMajorUnit: true,
                     fields: ['main'],
-                    minimum: 0
+                    minimum: 0,
+                    grid: {
+                        even: {
+                            stroke: '#E7EBEF'
+                        },
+                        odd: {
+                            stroke: '#E7EBEF',
+                        }
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
                 }, {
                     type: 'category',
                     position: 'bottom',
-                    grid: true,
                     fields: ['x'],
-                    label: {
-                        rotate: {
-                            degrees: -45
-                        }
-                    }
+                    style: {
+                        fill: '#E7EBEF',
+                        strokeStyle: 'transparent'
+                    },
                 }],
                 series: [{
                     type: 'bar',
@@ -56,7 +66,9 @@ Ext.define('saas.view.home.charts.MonthIO', {
                     yField: ['main', 'other'],
                     stacked: true,
                     style: {
-                        opacity: 0.80
+                        lineWidth: 0,
+                        strokeStyle: 'transparent',
+                        maxBarWidth: 50,
                     },
                     tooltip: {
                         trackMouse: true,

+ 28 - 11
frontend/saas-web/app/view/home/charts/MonthPurchase.js

@@ -29,23 +29,40 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
                 },
                 axes: [{
                     type: 'category',
-                    fields: [
-                        'x'
-                    ],
-                    position: 'bottom'
+                    fields: ['x'],
+                    position: 'bottom',
+                    style: {
+                        fill: '#E7EBEF',
+                        strokeStyle: 'transparent'
+                    },
                 },{
                     type: 'numeric',
-                    fields: [
-                        'y'
-                    ],
-                    position: 'left'
+                    fields: ['y'],
+                    position: 'left',
+                    adjustByMajorUnit: true,
+                    grid: {
+                        even: {
+                            stroke: '#E7EBEF'
+                        },
+                        odd: {
+                            stroke: '#E7EBEF',
+                        }
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
+                    minimum: 0
                 }],
                 series: [{
                     type: 'bar',
                     xField: 'x',
-                    yField: [
-                        'y'
-                    ],
+                    yField: ['y'],
+                    style: {
+                        lineWidth: 0,
+                        strokeStyle: 'transparent',
+                        maxBarWidth: 50,
+                    },
                     tooltip: {
                         trackMouse: true,
                         renderer: me.onBarTipRender

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

@@ -36,8 +36,12 @@ Ext.define('saas.view.home.charts.MonthSale', {
                 width: '100%',
                 innerPadding: 20,
                 // legend: {
-                //     docked: 'bottom'
+                //     type: 'dom',
+                //     docked: 'right'
                 // },
+                style: {
+                    stroke: "#789"
+                },
                 interactions: ['rotate', 'itemhighlight'],
                 series: [{
                     type: 'pie',
@@ -52,6 +56,10 @@ Ext.define('saas.view.home.charts.MonthSale', {
                         trackMouse: true,
                         renderer: me.onSeriesTooltipRender
                     },
+                    style: {
+                        lineWidth: 0,
+                        strokeStyle: 'transparent',
+                    },
                 }]
             }],
         });

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

@@ -30,11 +30,27 @@ Ext.define('saas.view.home.charts.PurchaseTrend', {
                 axes: [{
                     type: 'category',
                     fields: ['x'],
-                    position: 'bottom'
+                    position: 'bottom',
+                    style: {
+                        fill: '#E7EBEF',
+                        strokeStyle: 'transparent'
+                    },
                 },{
                     type: 'numeric',
                     fields: ['y'],
-                    position: 'left'
+                    position: 'left',
+                    grid: {
+                        even: {
+                            stroke: '#E7EBEF'
+                        },
+                        odd: {
+                            stroke: '#E7EBEF',
+                        }
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
                 }],
                 series: [{
                     type: 'bar',
@@ -43,7 +59,12 @@ Ext.define('saas.view.home.charts.PurchaseTrend', {
                     tooltip: {
                         trackMouse: true,
                         renderer: me.onBarTipRender
-                    }
+                    },
+                    style: {
+                        lineWidth: 0,
+                        strokeStyle: 'transparent',
+                        maxBarWidth: 50,
+                    },
                 }]
             }]
         });

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

@@ -28,6 +28,11 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                 bind: {
                     store: '{sale_trend}',
                 },
+                // legend: {
+                //     type: 'dom',
+                //     docked: 'top',
+
+                // },
                 axes: [{
                     type: 'category',
                     fields: ['x'],
@@ -36,11 +41,27 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                         rotate: {
                             degrees: -25
                         }
-                    }
+                    },
+                    style: {
+                        fill: '#E7EBEF',
+                        strokeStyle: 'transparent'
+                    },
                 },{
                     type: 'numeric',
                     fields: ['sale', 'saleback'],
                     position: 'left',
+                    grid: {
+                        even: {
+                            stroke: '#E7EBEF',
+                        },
+                        odd: {
+                            stroke: '#E7EBEF',
+                        }
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
                 }],
                 series: [{
                     type: 'line',

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

@@ -30,11 +30,27 @@ Ext.define('saas.view.home.charts.StockAmount', {
                 axes: [{
                     type: 'category',
                     fields: ['x'],
-                    position: 'bottom'
+                    position: 'bottom',
+                    style: {
+                        fill: '#E7EBEF',
+                        strokeStyle: 'transparent'
+                    },
                 },{
                     type: 'numeric',
                     fields: ['y'],
-                    position: 'left'
+                    position: 'left',
+                    grid: {
+                        even: {
+                            stroke: '#E7EBEF',
+                        },
+                        odd: {
+                            stroke: '#E7EBEF',
+                        }
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
                 }],
                 series: [{
                     type: 'bar',
@@ -43,7 +59,12 @@ Ext.define('saas.view.home.charts.StockAmount', {
                     tooltip: {
                         trackMouse: true,
                         renderer: me.onBarTipRender
-                    }
+                    },
+                    style: {
+                        lineWidth: 0,
+                        strokeStyle: 'transparent',
+                        maxBarWidth: 50,
+                    },
                 }]
             }]
         });

+ 7 - 2
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -177,12 +177,17 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         columnWidth : 0.75
     }, {
         xtype : "textfield", 
-        name : "ft_recorder", 
+        name : "creatorId", 
+        fieldLabel : "录入人ID", 
+        hidden:true
+    }, {
+        xtype : "textfield", 
+        name : "creator", 
         fieldLabel : "录入人", 
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "ft_recorddate",
+        name : "createTime",
         fieldLabel : "录入日期",
         readOnly:true
     }

+ 6 - 2
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -159,11 +159,15 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 valueField: 'value',
                 store:Ext.create('Ext.data.Store', {
                     fields: ['value', 'display'],
-                    data : [{value:"信用卡", display:"信用卡"},
+                    data : [
+                        {value:"信用卡", display:"信用卡"},
                         {value:"支票", display:"支票"},
                         {value:"汇票", display:"汇票"},
                         {value:"现金", display:"现金"},
-                        {value:"银行转账", display:"银行转账"}]
+                        {value:"银行转账", display:"银行转账"},
+                        {value:"支付宝转账", display:"支付宝转账"},
+                        {value:"微信转账", display:"微信转账"}
+                    ]
                 })
             }
         }, {

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

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

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

@@ -112,7 +112,7 @@ Ext.define('saas.view.sale.report.SaleProfitController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=sd_prodcode]':{
+            'dbfindtrigger[name=pr_code]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',

+ 0 - 24
frontend/saas-web/app/view/sys/account/AccountInformation.js

@@ -1,24 +0,0 @@
-/**
- * Created by zhouy on 2018/10/18.
- */
-Ext.define('saas.view.sys.account.AccountInformation', {
-    extend: 'saas.view.document.kind.Kind',
-    xtype: 'sys-account-accountinformation',
-    autoScroll: true,
-    layout:'fit',
-    defaultType:'accountinformation',
-    tbar: ['->',{
-        xtype:'button',
-        text:'刷新',
-        listeners: {
-            click: 'onRefresh'
-        }
-    }],
-    listeners:{
-        afterrender:function(p){
-            p.getViewModel().setData({title:'账户信息'});
-        }
-    }
-})
-
-

+ 358 - 0
frontend/saas-web/app/view/sys/account/DataList.js

@@ -0,0 +1,358 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.sys.account.DataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'sys-account-datalist',
+    controller: 'sys-account-datalist',
+    viewModel: 'sys-account-datalist',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    dataUrl:'http://192.168.253.31:8560/api/account/account/accountRole/list',                 
+
+    tbar: [{
+        width: 150,
+        name: 'username',
+        xtype: 'textfield',
+        emptyText : '账户名称'
+    },{
+        width: 150,
+        name: 'mobile',
+        xtype: 'textfield',
+        emptyText : '电话'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+
+    columns : [{
+        text : 'id', 
+        hidden:true,
+        dataIndex : 'id', 
+        xtype : 'numbercolumn',   
+    },{
+        text : 'accountId', 
+        hidden:true,
+        dataIndex : 'accountId', 
+        xtype : 'numbercolumn',   
+    },{
+        text : '账户名称', 
+        width : 200.0, 
+        dataIndex : 'username', 
+        xtype : '', 
+    }, 
+    {
+        text : '真实姓名', 
+        dataIndex : 'realname', 
+        width : 120.0, 
+        xtype : '', 
+    }, 
+    {
+        text : '联系电话', 
+        dataIndex : 'mobile', 
+        width : 220.0,
+    },{
+        text : '联系邮箱', 
+        dataIndex : 'email', 
+        width : 120.0, 
+        xtype : '', 
+    },{
+        text : '关联角色id', 
+        hidden:true,
+        dataIndex : 'roleIds', 
+        width : 120.0, 
+        xtype : '', 
+    },{
+        text : '关联角色', 
+        dataIndex : 'roleNames', 
+        width : 120.0, 
+        xtype : '', 
+    }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.columns = me.insertFirstColumn(me.columns);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = '';
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    onVastDeal:function(url,type){
+        var form = this.ownerCt;
+        var grid = this;
+        var data = grid.getGridSelected(type);
+        if(!data){
+            showToast('请勾选符合条件的行进行操作。');
+            return false;
+        }
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            form.BaseUtil.request({
+                    url: url,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    showToast('操作成功');
+                    grid.store.load();
+                })
+                .catch(function(response) {
+                    showToast('操作失败');
+                });
+        }else{
+            showToast('请勾选至少一条明细。');
+        }
+    },
+
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
+        itemClick: function(view,record,a,index,c) {
+            var classList = c.target.classList.value;
+            var grid = this;
+            if(classList.indexOf('fa-pencil')>-1){
+                var document = Ext.create('saas.view.document.kind.Kind',{});
+                var form = this.ownerCt;
+                this.dialog = form.getController().getView().add({
+                    xtype: 'document-kind-childwin',
+                    bind: {
+                        title: '修改单据编码规则'
+                    },
+                    dataKind:'maxnumbers',
+                    belong:document.etc['maxnumbers'],
+                    _parent:form,
+                    _combo:this,
+                    record:record,
+                    session: true
+                });
+                this.dialog.show();
+            }
+        }
+    },
+
+    insertFirstColumn:function(columns){
+        var me=this;
+        if(columns.length>0 && columns[0].xtype!='actioncolumn'){
+            return Ext.Array.insert(columns,0,[{
+                xtype:'actioncolumn',
+                width:50,
+                dataIndex:'actioncolumn',
+                text:'操作',
+                items: [{
+                    tooltip: '编辑',
+                    iconCls: 'x-fa fa-pencil fa-fw',
+                    scope:this
+                }]
+            }]);
+        }
+        return columns;
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
+})
+
+

+ 10 - 0
frontend/saas-web/app/view/sys/account/DataListController.js

@@ -0,0 +1,10 @@
+Ext.define('saas.view.sys.account.DataListController', {
+    extend: 'saas.view.core.base.BasePanelController',
+    alias: 'controller.sys-account-datalist',
+
+    init: function (form) {
+        var me = this;
+        this.control({
+        });
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/sys/account/DataListlModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.sys.account.DataListModel', {
+    extend: 'saas.view.core.base.BasePanelModel',
+    alias: 'viewmodel.sys-account-datalist'
+});

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

@@ -29,16 +29,13 @@ Ext.define('saas.view.sys.config.FormPanel', {
         blankText: '该字段不能为空'
     },
 
-    tbar:{
-        style: {
-            'border-bottom': '1px solid #35baf6 !important'
-        },
+    bbar:{
         frame:true,
         items:['->',{
             text:'保存',
             formBind:true,
             name:'save'
-        }]
+        },'->']
     },
 
     items: [{
@@ -72,14 +69,14 @@ Ext.define('saas.view.sys.config.FormPanel', {
         fieldLabel: '电话',
         beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         allowBlank: false,
-        columnWidth: 0.25
+        width:500
     },{
         bind:'{en_fax}',
         xtype: 'textfield',
         name: 'en_fax',
         fieldLabel: '传真',
         allowBlank: true,
-        columnWidth: 0.5
+        width:500
     },{
         bind:'{en_begindate}',
         xtype : "datefield", 
@@ -89,13 +86,15 @@ Ext.define('saas.view.sys.config.FormPanel', {
         allowBlank : true, 
         editable:false,
         hideTrigger:true,
-        readOnly:true
+        readOnly:true,
+        width:500
     },{ 
         bind:'{en_pricemethod}',
         displayField : "display", 
         editable:false,
         hideTrigger : false, 
         maxLength : 100.0, 
+        width:500,
         minValue : null, 
         queryMode : "local", 
         valueField : "value", 
@@ -112,14 +111,14 @@ Ext.define('saas.view.sys.config.FormPanel', {
         beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         fieldLabel : "库存计算方式", 
         allowBlank : false, 
-        columnWidth : 0.25
     },{  
         bind:'{en_signet}',
         name : "en_signet", 
         fieldLabel : "打印章上传", 
         allowBlank : false, 
-        columnWidth : 0.33,
+        width:500,
         xtype: 'filefield',
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         emptyText: '请选择图片',
         buttonText: '',
         buttonConfig: {
@@ -130,8 +129,9 @@ Ext.define('saas.view.sys.config.FormPanel', {
         name : "en_logo", 
         fieldLabel : "Logo上传", 
         allowBlank : false, 
-        columnWidth : 0.33,
+        width:500,
         xtype: 'filefield',
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         emptyText: '请选择图片',
         buttonText: '',
         buttonConfig: {
@@ -148,7 +148,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         format:'Y-m-d H:i:s',
         editable:false,
         readOnly:true,
-        columnWidth : 0.25
+        width:500,
     }],
 
     initComponent: function () {

+ 12 - 0
frontend/saas-web/app/view/sys/finish/DataList.js

@@ -109,6 +109,18 @@ Ext.define('saas.view.sys.finish.DataList', {
 
     condition:'',
 
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        }
+    },
+
     initComponent: function() {
         var me = this;
         if(me.columns){

+ 10 - 5
frontend/saas-web/app/view/sys/manager/FormPanel.js

@@ -4,6 +4,8 @@ Ext.define('saas.view.sys.manager.FormPanel', {
     
     layout:'fit',
 
+    cls:'sys-manager-formpanel',
+
     bodyCls:'x-manager-background',
     //工具类
     FormUtil: Ext.create('saas.util.FormUtil'),
@@ -11,7 +13,7 @@ Ext.define('saas.view.sys.manager.FormPanel', {
 
     tabBar: {
         layout: {
-            pack: 'left'
+            pack: 'center'
         },
         border: false
     },
@@ -22,15 +24,18 @@ Ext.define('saas.view.sys.manager.FormPanel', {
     },
 
     items: [{
-        icon:'x-fa fa-key',
+        cls:'sys-config-formpanel',
+        iconCls:'x-fa fa-building',
         title: '公司设置',
         xtype:'sys-config-formpanel'
     }, {
-        icon:'x-fa fa-key',
+        cls:'sys-account-datalist',
+        iconCls:'x-fa fa-key',
         title: '账户设置',
-        xtype:'panel' 
+        xtype:'sys-account-datalist' 
     }, {
-        icon:'x-fa fa-key',
+        cls:'sys-power-formpanel',
+        iconCls:'x-fa fa-user-circle-o',
         title: '权限设置',
         xtype:'sys-power-formpanel'
     }],

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

@@ -0,0 +1,48 @@
+.sys-manager-formpanel{
+    .x-tab-bar-default-top > .x-tab-bar-body-default {
+        padding: 8px 4px 8px 8px;
+    }
+    .x-tab-bar-default {
+        border-color: #35baf6;
+        border-width: 2px !important;
+        border: 1px solid #35baf6;
+        background-color: #ffffff;
+        border-bottom-width: 0 !important;
+    }
+    .x-tab.x-tab-active.x-tab-default{
+        background-color: #35baf6;
+    }
+    .x-tab.x-tab-active.x-tab-default .x-tab-icon-el {
+        color: #ffffff;
+    }
+    .x-tab.x-tab-active.x-tab-default .x-tab-inner-default {
+        color: #ffffff;
+    }
+    .x-tab-icon-el-default {
+        color: #a7a7a7;
+    }
+    .x-tab-inner-default {
+        color: #969696;
+    }
+}
+.sys-config-formpanel{
+    .x-form-item-label-default{
+        width:120px !important;
+        .x-form-item-label-inner{
+            width:100px !important;
+        }
+    }
+}
+.sys-account-datalist{
+    .x-grid-body{
+        padding:0 !important;
+    }
+}
+.sys-power-formpanel{
+    .x-panel-body-default-framed{
+        padding:0 !important;
+    }
+    .x-keyboard-mode .x-grid-item-focused .x-grid-cell-inner:before{
+        border:1px solid #ffffff;
+    }
+}

+ 9 - 0
frontend/saas-web/app/view/sys/maxnumbers/DataList.js

@@ -191,6 +191,15 @@ Ext.define('saas.view.sys.maxnumbers.DataList', {
     },
 
     listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
         itemClick: function(view,record,a,index,c) {
             var classList = c.target.classList.value;
             var grid = this;

+ 12 - 0
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -85,6 +85,18 @@ Ext.define('saas.view.sys.messagelog.DataList', {
 
     condition:'',
 
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+
+            store.setPageSize(pageSize);
+        }
+    },
+
     initComponent: function() {
         var me = this;
         if(me.columns){

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

@@ -18,7 +18,6 @@ Ext.define('saas.view.sys.power.FormPanel', {
     saveUrl:'http://192.168.253.31:8560/api/account/role/save/bind/resource',
 
     items: [{
-        title:'角色列表',
         region:'west',
         xtype: 'sys-power-treepanel',
         layout:'fit',
@@ -26,7 +25,6 @@ Ext.define('saas.view.sys.power.FormPanel', {
         width: '20%',
         useArrows: true
     },{
-        title:'权限列表',
         margin:'0 0 0 5',
         region:'center',
         layout:'fit',

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

@@ -3,18 +3,16 @@
  */
 Ext.define('saas.view.sys.power.GroupGrid', {
     extend: 'Ext.grid.Panel',
-    requires: [
-        'saas.view.sys.power.OtherField'
-    ],
     xtype: 'power-grid',
     bind:{
         store: '{powergrid}'
     },
-    tools:[{
+    tbar:['->',{
         xtype:'button',				
         text:'保存',
         name:'savepower',
-        margin:'0 0 0 2',
+        margin:'0 10 0 2',
+        cls:'x-formpanel-btn-orange',
         style:'background:#da8282;border-color:#cccccc'
     }],
     features : [Ext.create('Ext.grid.feature.Grouping',{
@@ -27,18 +25,19 @@ Ext.define('saas.view.sys.power.GroupGrid', {
 	})],
     initId:0,
     dataUrl:'http://192.168.253.31:8560/api/account/role/power/resource',
-    selModel:Ext.create('Ext.selection.CheckboxModel', {
-        checkOnly: true,
+    selModel: {
         showHeaderCheckbox:false,
-        listeners: {
-            'select': function (selModel, record) {
+        checkOnly:true,
+        type:'checkboxmodel',
+        listeners:{
+            select:function(selModel,record,c,d){
                 selModel.view.ownerCt.selectAllPower(record);
             },
-            'deselect': function (selModel, record) {
+            deselect:function(selModel,record){
                 selModel.view.ownerCt.deselectAllPower(record);
             }
-        }
-    }),
+         }
+    },
     viewConfig: {
      stripeRows: false,
      enableTextSelection: false,
@@ -50,7 +49,8 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         dataIndex: 'groupName',
         xtype: '',
         flex: 2,
-        stopSelection: false
+        stopSelection: false,
+        menuDisabled:true,
     },{
         header: '查询',
         dataIndex: 'query',
@@ -406,12 +406,6 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         me.callParent(arguments);
     },
 
-    defaultListenerScope: true,
-
-    listeners: {
-        columnshow: 'onColumnToggle',
-        columnhide: 'onColumnToggle',
-    },
     selectAllPower: function(record){
         var me = this;
         me.setAllOthers(record,true);

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

@@ -92,7 +92,6 @@ Ext.define('saas.view.sys.power.TreePanel', {
                 var grid = view.ownerCt.ownerCt.query('power-grid')[0];
                 grid.initId = id;
                 grid.store.load();
-                grid.store.group('moduleName', 'ASC');
             }
         }
     },

+ 1 - 11
frontend/saas-web/resources/json/navigation.json

@@ -288,21 +288,11 @@
             "text": "新手导航",
             "viewType": "sys-guide-formpanel",
             "leaf": true
-        },{  
+        }, {  
             "id":"sys-manager-formpanel",
             "text": "系统管理",
             "viewType": "sys-manager-formpanel",
             "leaf": true
-        }, {  
-            "id":"sys-config-formpanel",
-            "text": "公司设置",
-            "viewType": "sys-config-formpanel",
-            "leaf": true
-        }, {
-            "id":"sys-power-formpanel",
-            "text": "权限设置",
-            "viewType": "sys-power-formpanel",
-            "leaf": true
         }, {
             "id":"sys-messagelog-datalist",
             "text": "操作日志",