Browse Source

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

guq 7 years ago
parent
commit
a3d2dea1cd
24 changed files with 1046 additions and 79 deletions
  1. 27 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/SubledgerController.java
  2. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  3. 28 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java
  4. 30 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Banksubledger.java
  5. 141 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java
  6. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/BanksubledgerService.java
  7. 14 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/SubledgerService.java
  8. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/BanksubledgerServiceImpl.java
  9. 90 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  10. 55 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/SubledgerServiceImpl.java
  11. 41 26
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  12. 244 0
      applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml
  13. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  14. 32 1
      frontend/saas-web/app/model/document/product.js
  15. 31 1
      frontend/saas-web/app/model/document/productDTO.js
  16. 21 3
      frontend/saas-web/app/model/purchase/purchasedetail.js
  17. 10 6
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  18. 7 14
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  19. 3 1
      frontend/saas-web/app/view/core/report/ReportPanel.js
  20. 5 1
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  21. 213 1
      frontend/saas-web/app/view/document/bom/FormController.js
  22. 26 6
      frontend/saas-web/app/view/document/bom/FormPanel.js
  23. 8 0
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  24. 14 14
      frontend/saas-web/app/view/purchase/report/Purchase.js

+ 27 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/SubledgerController.java

@@ -0,0 +1,27 @@
+package com.usoftchina.saas.money.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.service.SubledgerService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:05
+ **/
+@RestController
+@RequestMapping("/subledger")
+public class SubledgerController {
+    @Autowired
+    private SubledgerService subledgerService;
+
+    @GetMapping("/list")
+    public Result getListData(PageRequest page, ListReqDTO condition){
+        return Result.success(subledgerService.seleteList(page, condition));
+    }
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -17,7 +17,7 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
 
     int deleteByExample(BanksubledgerExample example);
 
-    int deleteByPrimaryKey(Integer bl_id);
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
 
 //    Long insert(Banksubledger record);
 

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

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 10:33
+ **/
+public interface SubledgerMapper {
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
+
+    int insert(Subledger record);
+
+    int insertSelective(Subledger record);
+
+    Subledger selectByPrimaryKey(Integer sl_id);
+
+    int updateByPrimaryKeySelective(Subledger record);
+
+    int updateByPrimaryKey(Subledger record);
+
+    List<Subledger> selectSubledgerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 30 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Banksubledger.java

@@ -42,6 +42,36 @@ public class Banksubledger extends CommonBaseEntity implements Serializable {
  
     private String bl_remark;    //备注
 
+    private Double bl_orderamount;
+
+    private Integer bl_assid;
+
+    private String bl_item;
+
+    public Double getBl_orderamount() {
+        return bl_orderamount;
+    }
+
+    public void setBl_orderamount(Double bl_orderamount) {
+        this.bl_orderamount = bl_orderamount;
+    }
+
+    public Integer getBl_assid() {
+        return bl_assid;
+    }
+
+    public void setBl_assid(Integer bl_assid) {
+        this.bl_assid = bl_assid;
+    }
+
+    public String getBl_item() {
+        return bl_item;
+    }
+
+    public void setBl_item(String bl_item) {
+        this.bl_item = bl_item;
+    }
+
     public Integer getBl_id() {
         return bl_id;
     }

+ 141 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java

@@ -0,0 +1,141 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+//中间表
+public class Subledger extends CommonBaseEntity implements Serializable {
+
+    private String sl_code;
+
+    private String sl_kind;
+
+    private Integer sl_custid;
+
+    private Integer sl_vendid;
+
+    private Date sl_date;
+
+    private Double sl_amount;
+
+    private Double sl_preamount;
+
+    private Double sl_yamount;
+
+    private Double sl_namount;
+
+    private String sl_remark;
+
+    private Double sl_orderamount;
+
+    private Double sl_discount;
+
+    private Integer sl_ym;
+
+    public String getSl_code() {
+        return sl_code;
+    }
+
+    public void setSl_code(String sl_code) {
+        this.sl_code = sl_code;
+    }
+
+    public String getSl_kind() {
+        return sl_kind;
+    }
+
+    public void setSl_kind(String sl_kind) {
+        this.sl_kind = sl_kind;
+    }
+
+    public Integer getSl_custid() {
+        return sl_custid;
+    }
+
+    public void setSl_custid(Integer sl_custid) {
+        this.sl_custid = sl_custid;
+    }
+
+    public Integer getSl_vendid() {
+        return sl_vendid;
+    }
+
+    public void setSl_vendid(Integer sl_vendid) {
+        this.sl_vendid = sl_vendid;
+    }
+
+    public Date getSl_date() {
+        return sl_date;
+    }
+
+    public void setSl_date(Date sl_date) {
+        this.sl_date = sl_date;
+    }
+
+    public Double getSl_amount() {
+        return sl_amount;
+    }
+
+    public void setSl_amount(Double sl_amount) {
+        this.sl_amount = sl_amount;
+    }
+
+    public Double getSl_preamount() {
+        return sl_preamount;
+    }
+
+    public void setSl_preamount(Double sl_preamount) {
+        this.sl_preamount = sl_preamount;
+    }
+
+    public Double getSl_yamount() {
+        return sl_yamount;
+    }
+
+    public void setSl_yamount(Double sl_yamount) {
+        this.sl_yamount = sl_yamount;
+    }
+
+    public Double getSl_namount() {
+        return sl_namount;
+    }
+
+    public void setSl_namount(Double sl_namount) {
+        this.sl_namount = sl_namount;
+    }
+
+    public String getSl_remark() {
+        return sl_remark;
+    }
+
+    public void setSl_remark(String sl_remark) {
+        this.sl_remark = sl_remark;
+    }
+
+
+    public Double getSl_orderamount() {
+        return sl_orderamount;
+    }
+
+    public void setSl_orderamount(Double sl_orderamount) {
+        this.sl_orderamount = sl_orderamount;
+    }
+
+    public Double getSl_discount() {
+        return sl_discount;
+    }
+
+    public void setSl_discount(Double sl_discount) {
+        this.sl_discount = sl_discount;
+    }
+
+    public Integer getSl_ym() {
+        return sl_ym;
+    }
+
+    public void setSl_ym(Integer sl_ym) {
+        this.sl_ym = sl_ym;
+    }
+}

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

@@ -1,5 +1,7 @@
 package com.usoftchina.saas.money.service;
 
+import com.usoftchina.saas.money.po.Banksubledger;
+
 /**
  * @author hx
  * @createtime 2018-10-19 15:59

+ 14 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/SubledgerService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.money.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.page.PageRequest;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:07
+ **/
+public interface SubledgerService {
+    PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO);
+}

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

@@ -1,10 +1,12 @@
 package com.usoftchina.saas.money.service.impl;
 
 import com.usoftchina.saas.money.service.BanksubledgerService;
+import org.springframework.stereotype.Service;
 
 /**
  * @author hx
  * @createtime 2018-10-19 16:00
  */
+@Service
 public class BanksubledgerServiceImpl implements BanksubledgerService {
 }

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

@@ -11,12 +11,11 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
-import com.usoftchina.saas.money.mapper.PaybalanceMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetailMapper;
+import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -38,6 +37,10 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     private PaybalancedetailMapper paybalancedetailMapper;
     @Autowired
     private MaxnumberService maxnumberService;
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+    @Autowired
+    private BanksubledgerMapper banksubledgerMapper;
 
     public DocBaseDTO insert(Pay pay) {
         Paybalance paybalance = pay.getMain();
@@ -99,6 +102,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setCompanyId(companyId);
+        Subledger subledger = this.changSubledgerUntil(paybalance);
+        subledgerMapper.insertSelective(subledger);
+        this.changBankUntil(pay);
+        System.out.println("新增");
+        this.changBankUntil(pay);
         if ( paybalance == null || "".equals(paybalance)){
             this.insert(pay);
         }else {
@@ -113,6 +121,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
+
+        //删除中间表
+        paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
+        banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
     }
 
 
@@ -219,4 +232,78 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         }
         return paybalanceList;
     }
+
+
+    //插入中间表
+    public Subledger changSubledgerUntil(Paybalance paybalance){
+        Subledger subledger = new Subledger();
+//        BeanUtils.copyProperties(subledger, paybalance);
+        subledger.setCompanyId(BaseContextHolder.getCompanyId());
+        subledger.setSl_code(paybalance.getPb_code());
+        subledger.setSl_kind(paybalance.getPb_kind());
+        subledger.setSl_custid(0);
+//        subledger.setSl_vendid(paybalance.getPb_vendid());
+        subledger.setSl_vendid(1);
+        subledger.setSl_date(paybalance.getPb_date());
+        if (paybalance.getPb_pdamount() == null){
+            subledger.setSl_amount((double) 0);
+        }else {
+            subledger.setSl_amount(paybalance.getPb_pdamount() * -1);
+        }
+        subledger.setSl_orderamount(paybalance.getPb_pdamount());
+
+        Double yamount = paybalance.getPb_preamount();
+        if (yamount == null){
+            yamount = Double.valueOf(0);
+        }
+        if (yamount > 0 || yamount < 0){
+            subledger.setSl_yamount(yamount);
+        }else {
+            subledger.setSl_yamount((double) 0);
+        }
+        if (subledger.getSl_orderamount() == null){
+            subledger.setSl_orderamount((double) 0);
+        }
+
+        if (subledger.getSl_discount() == null){
+            subledger.setSl_discount((double) 0);
+        }
+        subledger.setSl_namount(subledger.getSl_orderamount() + subledger.getSl_discount() - subledger.getSl_yamount());
+        subledger.setSl_remark(subledger.getSl_remark());
+        subledger.setSl_preamount(subledger.getSl_preamount());
+
+        return subledger;
+    }
+
+    //插入bank中间表
+    public void changBankUntil(Pay pay){
+        Banksubledger banksubledger = new Banksubledger();
+        Paybalance paybalance = pay.getMain();
+        List<Paybalancedet> paybalancedetList = pay.getItems1();
+        Iterator isList = paybalancedetList.iterator();
+        while (isList.hasNext()) {
+            Paybalancedet paybalancedet = (Paybalancedet) isList.next();
+            banksubledger.setCompanyId(BaseContextHolder.getCompanyId());
+            banksubledger.setBl_ym(paybalancedet.getPd_ym());
+            banksubledger.setBl_bankid(paybalancedet.getPd_bankid());
+            banksubledger.setBl_bankcode(paybalancedet.getPd_bankcode());
+            banksubledger.setBl_bankname(paybalancedet.getPd_bankname());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_kind(paybalance.getPb_kind());
+            banksubledger.setBl_date(paybalance.getPb_date());
+
+            if (paybalance.getPb_vendid() == null || paybalance.getPb_vendid() != 0){
+                banksubledger.setBl_asscode("供应商往来");
+            }
+            banksubledger.setBl_assid(paybalance.getPb_vendid());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_assname(paybalance.getPb_vendname());
+            banksubledger.setBl_spending(paybalancedet.getPd_amount());
+            banksubledger.setBl_manname(paybalance.getPb_manname());
+            banksubledger.setBl_remark(paybalancedet.getPd_remark());
+            banksubledger.setBl_orderamount(paybalancedet.getPd_amount() * -1);
+            banksubledgerMapper.insertSelective(banksubledger);
+
+        }
+    }
 }

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

@@ -0,0 +1,55 @@
+package com.usoftchina.saas.money.service.impl;
+
+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.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.money.service.SubledgerService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:09
+ **/
+@Service
+public class SubledgerServiceImpl implements SubledgerService {
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+
+    @Override
+    public PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Subledger> subledgerList = this.getListByMode(reqDTO);
+        //取分页信息
+        PageInfo<Subledger> pageInfo = new PageInfo<Subledger>(subledgerList);
+        return pageInfo;
+    }
+
+    private List<Subledger> getListByMode(ListReqDTO req) {
+        List<Subledger> subledgerList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        subledgerList = subledgerMapper.selectSubledgerBycondition(con, companyId);
+        return subledgerList;
+    }
+}

+ 41 - 26
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.usoftchina.saas.money.mapper.BanksubledgerMapper">
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Banksubledger">
-        <id column="bl_id" jdbcType="INTEGER" property="bl_id" />
+        <id column="bl_id" jdbcType="INTEGER" property="id" />
         <result column="bl_ym" jdbcType="INTEGER" property="bl_ym" />
         <result column="bl_bankid" jdbcType="INTEGER" property="bl_bankid" />
         <result column="bl_bankcode" jdbcType="VARCHAR" property="bl_bankcode" />
@@ -17,9 +17,12 @@
         <result column="bl_spending" jdbcType="DOUBLE" property="bl_spending" />
         <result column="bl_manname" jdbcType="VARCHAR" property="bl_manname" />
         <result column="bl_remark" jdbcType="VARCHAR" property="bl_remark" />
-        <result column="companyid" jdbcType="INTEGER" property="companyid" />
+        <result column="companyId" jdbcType="INTEGER" property="companyId" />
         <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
         <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate" />
+        <result column="bl_orderamount" property="bl_orderamount" jdbcType="DOUBLE" />
+        <result column="bl_assid" property="bl_assid" jdbcType="INTEGER" />
+        <result column="bl_item" property="bl_item" jdbcType="VARCHAR" />
     </resultMap>
     <sql id="Example_Where_Clause">
         <where>
@@ -81,8 +84,8 @@
     </sql>
     <sql id="Base_Column_List">
     bl_id, bl_ym, bl_bankid, bl_bankcode, bl_bankname, bl_code, bl_kind, bl_date, bl_asstype, 
-    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyid, 
-    updaterId, updatedate
+    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyId, 
+    updaterId, updatedate, bl_orderamount, bl_assid, bl_item
   </sql>
     <select id="selectByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample" resultMap="BaseResultMap">
         select
@@ -106,7 +109,7 @@
     </select>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from banksubledger
-    where bl_id = #{bl_id,jdbcType=INTEGER}
+    where bl_id = #{code,jdbcType=VARCHAR} and bl_kind = #{kind, jdbcType=VARCHAR}
   </delete>
     <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample">
         delete from banksubledger
@@ -120,22 +123,19 @@
       bl_kind, bl_date, bl_asstype, 
       bl_asscode, bl_assname, bl_income, 
       bl_spending, bl_manname, bl_remark, 
-      companyid, updaterId, updatedate
+      companyId, updaterId, updatedate
       )
     values (#{bl_id,jdbcType=INTEGER}, #{bl_ym,jdbcType=INTEGER}, #{bl_bankid,jdbcType=INTEGER}, 
       #{bl_bankcode,jdbcType=VARCHAR}, #{bl_bankname,jdbcType=VARCHAR}, #{bl_code,jdbcType=VARCHAR}, 
       #{bl_kind,jdbcType=VARCHAR}, #{bl_date,jdbcType=TIMESTAMP}, #{bl_asstype,jdbcType=VARCHAR}, 
       #{bl_asscode,jdbcType=VARCHAR}, #{bl_assname,jdbcType=VARCHAR}, #{bl_income,jdbcType=DOUBLE}, 
       #{bl_spending,jdbcType=DOUBLE}, #{bl_manname,jdbcType=VARCHAR}, #{bl_remark,jdbcType=VARCHAR}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
       )
   </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Banksubledger">
         insert into banksubledger
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                bl_id,
-            </if>
             <if test="bl_ym != null">
                 bl_ym,
             </if>
@@ -178,20 +178,26 @@
             <if test="bl_remark != null">
                 bl_remark,
             </if>
-            <if test="companyid != null">
-                companyid,
+            <if test="companyId != null">
+                companyId,
             </if>
             <if test="updaterId != null">
                 updaterId,
             </if>
-            <if test="updatedate != null">
+            <if test="updateTime != null">
                 updatedate,
             </if>
+            <if test="bl_orderamount != null" >
+                bl_orderamount,
+            </if>
+            <if test="bl_assid != null" >
+                bl_assid,
+            </if>
+            <if test="bl_item != null" >
+                bl_item,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                #{bl_id,jdbcType=INTEGER},
-            </if>
             <if test="bl_ym != null">
                 #{bl_ym,jdbcType=INTEGER},
             </if>
@@ -234,14 +240,23 @@
             <if test="bl_remark != null">
                 #{bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="companyid != null">
-                #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 #{updaterId,jdbcType=INTEGER},
             </if>
-            <if test="updatedate != null">
-                #{updatedate,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="bl_orderamount != null" >
+                #{bl_orderamount,jdbcType=DOUBLE},
+            </if>
+            <if test="bl_assid != null" >
+                #{bl_assid,jdbcType=INTEGER},
+            </if>
+            <if test="bl_item != null" >
+                #{bl_item,jdbcType=VARCHAR},
             </if>
         </trim>
     </insert>
@@ -299,8 +314,8 @@
             <if test="record.bl_remark != null">
                 bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="record.companyid != null">
-                companyid = #{record.companyid,jdbcType=INTEGER},
+            <if test="record.companyId != null">
+                companyId = #{record.companyId,jdbcType=INTEGER},
             </if>
             <if test="record.updaterId != null">
                 updaterId = #{record.updaterId,jdbcType=INTEGER},
@@ -330,7 +345,7 @@
         bl_spending = #{record.bl_spending,jdbcType=DOUBLE},
         bl_manname = #{record.bl_manname,jdbcType=VARCHAR},
         bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
-        companyid = #{record.companyid,jdbcType=INTEGER},
+        companyId = #{record.companyId,jdbcType=INTEGER},
         updaterId = #{record.updaterId,jdbcType=INTEGER},
         updatedate = #{record.updatedate,jdbcType=TIMESTAMP}
         <if test="_parameter != null">
@@ -382,8 +397,8 @@
             <if test="bl_remark != null">
                 bl_remark = #{bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="companyid != null">
-                companyid = #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                companyId = #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 updaterId = #{updaterId,jdbcType=INTEGER},
@@ -410,7 +425,7 @@
       bl_spending = #{bl_spending,jdbcType=DOUBLE},
       bl_manname = #{bl_manname,jdbcType=VARCHAR},
       bl_remark = #{bl_remark,jdbcType=VARCHAR},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP}
     where bl_id = #{bl_id,jdbcType=INTEGER}

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

@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.SubledgerMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Subledger" >
+    <id column="sl_id" property="id" jdbcType="INTEGER" />
+    <result column="sl_code" property="sl_code" jdbcType="VARCHAR" />
+    <result column="sl_kind" property="sl_kind" jdbcType="VARCHAR" />
+    <result column="sl_custid" property="sl_custid" jdbcType="INTEGER" />
+    <result column="sl_vendid" property="sl_vendid" jdbcType="INTEGER" />
+    <result column="sl_date" property="sl_date" jdbcType="TIMESTAMP" />
+    <result column="sl_amount" property="sl_amount" jdbcType="DOUBLE" />
+    <result column="sl_preamount" property="sl_preamount" jdbcType="DOUBLE" />
+    <result column="sl_yamount" property="sl_yamount" jdbcType="DOUBLE" />
+    <result column="sl_namount" property="sl_namount" jdbcType="DOUBLE" />
+    <result column="sl_remark" property="sl_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="sl_orderamount" property="sl_orderamount" jdbcType="DOUBLE" />
+    <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
+    <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount, 
+    sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount, 
+    sl_discount, sl_ym
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from subledger
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from subledger
+    where sl_code = #{code,jdbcType=VARCHAR} and sl_kind = #{kind, jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger (sl_id, sl_code, sl_kind, 
+      sl_custid, sl_vendid, sl_date, 
+      sl_amount, sl_preamount, sl_yamount, 
+      sl_namount, sl_remark, companyId, 
+      updaterId, updateTime, sl_orderamount, 
+      sl_discount, sl_ym)
+    values (#{sl_id,jdbcType=INTEGER}, #{sl_code,jdbcType=VARCHAR}, #{sl_kind,jdbcType=VARCHAR}, 
+      #{sl_custid,jdbcType=INTEGER}, #{sl_vendid,jdbcType=INTEGER}, #{sl_date,jdbcType=TIMESTAMP}, 
+      #{sl_amount,jdbcType=DOUBLE}, #{sl_preamount,jdbcType=DOUBLE}, #{sl_yamount,jdbcType=DOUBLE}, 
+      #{sl_namount,jdbcType=DOUBLE}, #{sl_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{sl_orderamount,jdbcType=DOUBLE}, 
+      #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        sl_code,
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind,
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid,
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid,
+      </if>
+      <if test="sl_date != null" >
+        sl_date,
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount,
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount,
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount,
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount,
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount,
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount,
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    <set >
+      <if test="sl_code != null" >
+        sl_code = #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid = #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym = #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </set>
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    set sl_code = #{sl_code,jdbcType=VARCHAR},
+      sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      sl_custid = #{sl_custid,jdbcType=INTEGER},
+      sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      sl_ym = #{sl_ym,jdbcType=INTEGER}
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectSubledgerBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from subledger
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   subledger.companyId = #{companyId}
+      </if>
+    </where>  order by sl_id
+  </select>
+
+</mapper>

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -228,8 +228,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 id = baseDTO.getId();
             }
             singleAudit(formData.getMain());
+            baseDTO = getBaseDTOById(id,formData.getMain().getPi_class(),formData.getMain().getPi_inoutno());
         }
-        baseDTO.setId(id);
         return baseDTO;
     }
 

+ 32 - 1
frontend/saas-web/app/model/document/product.js

@@ -1,7 +1,38 @@
 Ext.define('saas.model.document.Product', {
     extend: 'saas.model.Base',
     fields: [
+        { name: 'id', type: 'int' },
+        { name: 'pr_id', type: 'int' },
+        { name: 'pr_code', type: 'string' },
         { name: 'pr_detail', type: 'string' },
-        { name: 'pr_unit', type: 'string' }
+        { name: 'pr_spec', type: 'string' },
+        { name: 'pr_unit', type: 'string' },
+        { name: 'pr_kind', type: 'string' },
+        { name: 'pr_orispeccode', type: 'string' },
+        { name: 'pr_whid', type: 'int' },
+        { name: 'pr_whcode', type: 'string' },
+        { name: 'pr_whname', type: 'string' },
+        { name: 'pr_zxbzs', type: 'float' },
+        { name: 'pr_leadtime', type: 'float' },
+        { name: 'pr_brand', type: 'string' },
+        { name: 'pr_standardprice', type: 'float' },
+        { name: 'pr_purcprice', type: 'float' },
+        { name: 'pr_saleprice', type: 'float' },
+        { name: 'pr_vendid', type: 'int' },
+        { name: 'pr_vendcode', type: 'string' },
+        { name: 'pr_vendname', type: 'string' },
+        { name: 'pr_docdate', type: 'date' },
+        { name: 'pr_recordmanid', type: 'int' },
+        { name: 'pr_recordman', type: 'string' },
+        { name: 'pr_status', type: 'string' },
+        { name: 'pr_statuscode', type: 'string' },
+        { name: 'companyid', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'updatedate', type: 'date' },
+        { name: 'pr_text1', type: 'string' },
+        { name: 'pr_text2', type: 'string' },
+        { name: 'pr_text3', type: 'string' },
+        { name: 'pr_text4', type: 'string' },
+        { name: 'pr_text5', type: 'string' }
     ]
 });

+ 31 - 1
frontend/saas-web/app/model/document/productDTO.js

@@ -1,8 +1,38 @@
 Ext.define('saas.model.document.ProductDTO', {
     extend: 'saas.model.Base',
     fields: [
+        { name: 'id', type: 'int' },
+        { name: 'pr_id', type: 'int' },
+        { name: 'pr_code', type: 'string' },
         { name: 'pr_detail', type: 'string' },
+        { name: 'pr_spec', type: 'string' },
         { name: 'pr_unit', type: 'string' },
-        { name: 'pr_spec', type: 'string' }
+        { name: 'pr_kind', type: 'string' },
+        { name: 'pr_orispeccode', type: 'string' },
+        { name: 'pr_whid', type: 'int' },
+        { name: 'pr_whcode', type: 'string' },
+        { name: 'pr_whname', type: 'string' },
+        { name: 'pr_zxbzs', type: 'float' },
+        { name: 'pr_leadtime', type: 'float' },
+        { name: 'pr_brand', type: 'string' },
+        { name: 'pr_standardprice', type: 'float' },
+        { name: 'pr_purcprice', type: 'float' },
+        { name: 'pr_saleprice', type: 'float' },
+        { name: 'pr_vendid', type: 'int' },
+        { name: 'pr_vendcode', type: 'string' },
+        { name: 'pr_vendname', type: 'string' },
+        { name: 'pr_docdate', type: 'date' },
+        { name: 'pr_recordmanid', type: 'int' },
+        { name: 'pr_recordman', type: 'string' },
+        { name: 'pr_status', type: 'string' },
+        { name: 'pr_statuscode', type: 'string' },
+        { name: 'companyid', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'updatedate', type: 'date' },
+        { name: 'pr_text1', type: 'string' },
+        { name: 'pr_text2', type: 'string' },
+        { name: 'pr_text3', type: 'string' },
+        { name: 'pr_text4', type: 'string' },
+        { name: 'pr_text5', type: 'string' }
     ]
 });

+ 21 - 3
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -2,16 +2,34 @@ Ext.define('saas.model.purchase.Purchasedetail', {
     extend: 'saas.model.Base',
 
     fields: [
-        { name: 'pd_detno', type: 'int' },
         { name: 'id', type: 'int' },
+        { name: 'pd_id', type: 'int' },
+        { name: 'pd_puid', type: 'int' },
+        { name: 'pd_code', type: 'string' },
+        { name: 'pd_detno', type: 'int' },
+        { name: 'pd_prodid', type: 'int' },
         { name: 'pd_prodcode', type: 'string' },
+        { name: 'pd_unit', type: 'string' },
         { name: 'pd_qty', type: 'float' },
         { name: 'pd_yqty', type: 'float' },
         { name: 'pd_price', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
+        { name: 'pd_taxprice', type: 'float' },
         { name: 'pd_total', type: 'float' },
+        { name: 'pd_taxrate', type: 'float' },
+        { name: 'pd_taxtotal', type: 'float' },
+        { name: 'pd_acceptqty', type: 'float' },
         { name: 'pd_delivery', type: 'date' },
-        { name: 'pd_taxtotal', type: 'float' }
+        { name: 'pd_salecode', type: 'string' },
+        { name: 'pd_saledetno', type: 'int' },
+        { name: 'pd_sdid', type: 'int' },
+        { name: 'companyid', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'updatedate', type: 'date' },
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]

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

@@ -20,12 +20,6 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         type: 'cellmodel'
     },
     
-    plugins: {
-        cellediting: {
-            clicksToEdit: 1
-        }
-    },
-
     showIndex: true,
     configUrl: '',
     editable: true,
@@ -45,6 +39,16 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         };
 
         Ext.apply(me, {
+            plugins: {
+                cellediting: {
+                    clicksToEdit: 1,
+                    listeners: {
+                        edit: function(editor, context, eOpts) {
+                            context.column.fireEvent('edit', context.value);
+                        }
+                    }
+                }
+            },
             normalViewConfig: {
                 deferEmptyText: false,
                 emptyText: '无数据'

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

@@ -42,6 +42,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 fields: me.getFields(),
                 autoLoad: true,
                 pageSize: 15,
+                exportPageSize: 5000,
+                exportNumber: 1,
                 data: [],
                 proxy: {
                     type: 'ajax',
@@ -271,20 +273,11 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     },
     onExport: function (me) {
         var grid = me.ownerCt.ownerCmp.ownerCt.ownerCt;
-        grid.ownerCt.setLoading(true);
-        grid.store.exportPageSize = 5000;
-        grid.store.exportNumber = 1;
-        grid.store.load(function(records, operation, success) {
-            grid.saveDocumentAs({
-                type: 'xlsx',
-                title: grid.addTitle + '列表',
-                fileName: grid.addTitle + '列表.xlsx'
-            });
-            grid.store.exportPageSize = null;
-            grid.store.exportNumber = null;
-            grid.store.load(function(records, operation, success) {
-                grid.ownerCt.setLoading(false);
-            });
+
+        grid.saveDocumentAs({
+            type: 'xlsx',
+            title: grid.addTitle + '列表',
+            fileName: grid.addTitle + '列表.xlsx'
         });
     },
     onCloseOrder:function(me){

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

@@ -154,6 +154,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             fields: me.getFields(),
             autoLoad: true,
             pageSize: 15,
+            exportPageSize: 5000,
+            exportNumber: 1,
             data: [],
             proxy: {
                 type: 'ajax',
@@ -194,7 +196,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     Ext.apply(store.proxy.extraParams, {
                         number: store.exportNumber?store.exportNumber:op._page,
                         size: store.exportPageSize?store.exportPageSize:store.pageSize,
-                        mode: 'MAIN',
+                        mode: 'DETAIL',
                         condition: JSON.stringify(condition)
                     });
     

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

@@ -19,11 +19,15 @@ Ext.define('saas.view.core.report.ReportPanelController', {
     },
 
     exportTo: function(btn){
+        var me = this,
+        reportPanel = me.getView(),
+        grid = reportPanel.getListGrid();
+
         var cfg = Ext.merge({
             title: 'Grid export demo',
             fileName: 'GridExport' + '.' + (btn.cfg.ext || btn.cfg.type)
         }, btn.cfg);
 
-        this.getView().saveDocumentAs(cfg);
+        grid.saveDocumentAs(cfg);
     }
 });

+ 213 - 1
frontend/saas-web/app/view/document/bom/FormController.js

@@ -4,7 +4,219 @@ Ext.define('saas.view.document.bom.FormController', {
     
     init: function (form) {
         var me = this;
-        this.control({});
+        this.control({
+            //从表多选放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=bd_soncode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl: '/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        //放大镜赋值设置
+                        dbfinds:[
+   {
+                            from:'pr_code',to:'bd_soncode'                          
+                        },{
+                            from:'pr_detail',to:'pr_detail'
+                        },{
+                            from:'pr_spec',to:'pr_spec'
+                        },{
+                            from:'pr_unit',to:'bd_unit'
+                        }],
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            width: 200,
+                            xtype : "textfield", 
+                            name : "search", 
+                            allowBlank : true, 
+                            columnWidth : 0.25,
+                            getCondition:function(v){
+                                return "(upper(pr_code) like '%" + v.toUpperCase() + "%' or upper(pr_detail) like '%"+ v.toUpperCase() +"%' or upper(pr_spec) like '%"+ v.toUpperCase() +"%')";
+                            }
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        }, {
+                            "text": "最新采购单价",
+                            "dataIndex": "pr_purcprice",
+                            "width": 0,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]   
+                    }) ;   
+                }
+            },
+            'multidbfindtrigger[name=bd_replace]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl: '/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        //放大镜赋值设置
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'bd_replace'                          
+                        },{
+                            from:'pr_detail',to:'pr_detail'
+                        },{
+                            from:'pr_spec',to:'pr_spec'
+                        },{
+                            from:'pr_unit',to:'pr_unit'
+                        }],
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            width: 200,
+                            xtype : "textfield", 
+                            name : "search", 
+                            allowBlank : true, 
+                            columnWidth : 0.25,
+                            getCondition:function(v){
+                                return "(upper(pr_code) like '%" + v.toUpperCase() + "%' or upper(pr_detail) like '%"+ v.toUpperCase() +"%' or upper(pr_spec) like '%"+ v.toUpperCase() +"%')";
+                            }
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        }, {
+                            "text": "最新采购单价",
+                            "dataIndex": "pr_purcprice",
+                            "width": 0,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]   
+                    }) ;   
+                }
+            }
+        });
     },
 
     auditBtnClick: function() {

+ 26 - 6
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -102,10 +102,20 @@ Ext.define('saas.view.document.bom.FormPanel', {
             {
                 allowBlank:false,
                 text : "子件编号", 
-                editor : {
-                    xtype : "textfield"
-                },
                 dataIndex : "bd_soncode", 
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "multidbfindtrigger"
+                }
             },
             {
                 allowBlank:false,
@@ -126,10 +136,20 @@ Ext.define('saas.view.document.bom.FormPanel', {
             {
                 allowBlank:false,
                 text : "替代料", 
-                editor : {
-                    xtype : "textfield"
-                },
                 dataIndex : "bd_replace", 
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "multidbfindtrigger"
+                }
             }]
     }],
 

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

@@ -128,6 +128,14 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                 }
             },
+            {
+                text : "最小包装数", 
+                dataIndex : "pr_zxbzs",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
+                }
+            },            
             {
                 text : "数量", 
                 dataIndex : "pd_qty", 

+ 14 - 14
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -20,7 +20,7 @@ Ext.define('saas.view.purchase.report.Purchase', {
 
     reportColumns: [{
         text: 'id',
-        dataIndex: 'id',
+        dataIndex: 'pu_id',
         hidden: true
     }, {
         text: '采购单号',
@@ -29,28 +29,28 @@ Ext.define('saas.view.purchase.report.Purchase', {
         width: 200
     }, {
         text: '供应商编号',
-        dataIndex: 'PU_VENDCODE',
+        dataIndex: 'pu_vendcode',
         width: 200
     }, {
         text: '供应商名称',
-        dataIndex: 'PU_VENDNAME',
+        dataIndex: 'pu_vendname',
         width: 200
     }, {
         text: '业务状态',
-        dataIndex: 'PU_STATUS'
+        dataIndex: 'pu_status'
     }, {
         text: '采购员',
-        dataIndex: 'PU_BUYERNAME'
+        dataIndex: 'pu_buyername'
     }, {
         text: '单据日期',
         xtype: 'datecolumn',
         dataIndex: 'pu_date'
     }, {
         text: '序号',
-        dataIndex: 'PD_DETNO'
+        dataIndex: 'pd_detno'
     }, {
         text: '物料编号',
-        dataIndex: 'pr_code'
+        dataIndex: 'pd_prodcode'
     }, {
         text: '物料名称',
         dataIndex: 'pr_detail'
@@ -65,28 +65,28 @@ Ext.define('saas.view.purchase.report.Purchase', {
         dataIndex: 'pr_unit'
     }, {
         text: '采购数量',
-        dataIndex: 'PD_QTY'
+        dataIndex: 'pd_qty'
     }, {
         text: '单价',
-        dataIndex: 'PD_PRICE'
+        dataIndex: 'pd_price'
     }, {
         text: '税率',
-        dataIndex: 'PD_TAXRATE'
+        dataIndex: 'pd_taxrate'
     }, {
         text: '金额',
-        dataIndex: 'PD_TOTAL'
+        dataIndex: 'pd_total'
     }, {
         text: '不含税单价',
         dataIndex: 'rbd_remark'
     }, {
         text: '不含税金额',
-        dataIndex: 'PD_TAXPRICE'
+        dataIndex: 'pd_taxprice'
     }, {
         text: '收货数量',
-        dataIndex: 'PD_YQTY'
+        dataIndex: 'pd_yqty'
     }, {
         text: '收货金额',
-        dataIndex: 'PD_TOTAL'
+        dataIndex: 'pd_total'
     }, {
         text: '备注'
     }]