rainco 7 tahun lalu
induk
melakukan
898c859f8c
30 mengubah file dengan 876 tambahan dan 968 penghapusan
  1. 10 12
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java
  2. 4 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java
  3. 3 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java
  4. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java
  5. 29 50
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  6. 23 23
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  7. 396 45
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  8. 4 1
      framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java
  9. 7 0
      frontend/saas-web/app/model/document/product.js
  10. 18 0
      frontend/saas-web/app/model/purchase/purchasedetail.js
  11. 2 14
      frontend/saas-web/app/util/FormUtil.js
  12. 6 1
      frontend/saas-web/app/view/auth/Login.js
  13. 5 3
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  14. 5 3
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  15. 1 0
      frontend/saas-web/app/view/core/form/FormPanelController.js
  16. 2 5
      frontend/saas-web/app/view/core/tab/Controller.js
  17. 34 9
      frontend/saas-web/app/view/document/kind/ChildForm.js
  18. 7 3
      frontend/saas-web/app/view/document/kind/Kind.js
  19. 23 2
      frontend/saas-web/app/view/document/kind/KindController.js
  20. 8 4
      frontend/saas-web/app/view/document/kind/KindModel.js
  21. 2 1
      frontend/saas-web/app/view/main/Main.js
  22. 4 0
      frontend/saas-web/app/view/main/MainContainerWrap.js
  23. 0 552
      frontend/saas-web/app/view/main/MainModel.js
  24. 245 228
      frontend/saas-web/app/view/main/Navigation.js
  25. 9 3
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  26. 8 2
      frontend/saas-web/app/view/purchase/purchaseIn/FormController.js
  27. 5 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  28. 7 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  29. 5 5
      frontend/saas-web/app/view/test/order/FormPanel.js
  30. 1 1
      frontend/saas-web/index.html

+ 10 - 12
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java

@@ -1,14 +1,10 @@
 package com.usoftchina.saas.commons.api;
-import com.usoftchina.saas.base.Result;
 
+import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
-/**
-* @Description: 编号接口
-* @Author: guq
-* @Date: 2018/10/20
-*/
+
 @FeignClient("commons-server")
 public interface MaxnumberService {
     /**
@@ -21,13 +17,15 @@ public interface MaxnumberService {
     @PostMapping("/number/pushMaxnubmer")
     public String pushMaxnubmer(@RequestParam("count") Integer count,@RequestParam("code") String code,
                                 @RequestParam("caller") String caller);
+
     /**
-    * @Description 获取单号
-    * @Param: [caller, update]
-    * @return: com.usoftchina.saas.base.Result
-    * @Author: guq
-    * @Date: 2018/10/22
-    */
+     * @Description 获取单号
+     * @Param: [caller, update]
+     * @return: com.usoftchina.saas.base.Result
+     * @Author: guq
+     * @Date: 2018/10/22
+     */
     @PostMapping("/getMaxnumber")
     public Result getMaxnumber(@RequestParam("caller") String caller, @RequestParam("update") boolean update);
+
 }

+ 4 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.purchase.dto;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.entities.Product;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -83,4 +84,7 @@ public class ProdIODetailDTO extends CommonBaseEntity implements Serializable {
     private String pd_remark;
 
     private Long pd_ioid;
+
+    private Product product;
+
 }

+ 3 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java

@@ -40,5 +40,7 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
 
     void batchUpdate(List<ProdIODetail> list);
 
-    void updatePurchaseYqty(Long id);
+    void updatePurchaseYqty(Integer id);
+
+    List<ProdIODetail> selectByFK(Long id);
 }

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.purchase.po;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.entities.Product;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -79,4 +80,6 @@ public class ProdIODetail extends CommonBaseEntity implements Serializable {
 
     private Long pd_ioid;
 
+    private Product product;
+
 }

+ 29 - 50
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -74,10 +74,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
               list = prodInOutListMapper.selectProdInOutListByCondition(req);
         } else {
               list = prodInOutListMapper.selectProdInOutBycondition(req);
-
         }
         return list;
-
     }
 
 
@@ -89,12 +87,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //将prodInOut实体对象转化为传输对象
         ProdInOutDTO main = BeanMapper.map(prodInOut,ProdInOutDTO.class);
         //查询从表
-        ProdIODetailExample prodIODetailExample = new ProdIODetailExample();
-        ProdIODetailExample.Criteria cta = prodIODetailExample.createCriteria();
-        cta.andPd_piidEqualTo(id.intValue());
-        List<ProdIODetail> prodIODetails =prodIODetailMapper.selectByExample(prodIODetailExample);
-        List<ProdIODetailDTO> items = BeanMapper.mapList(prodIODetails,ProdIODetailDTO.class);
 
+        List<ProdIODetail> prodIODetails =prodIODetailMapper.selectByFK(id);
+        List<ProdIODetailDTO> items = BeanMapper.mapList(prodIODetails,ProdIODetailDTO.class);
         prodInOutFormDTO.setMain(main);
         prodInOutFormDTO.setItems(items);
         return prodInOutFormDTO;
@@ -123,6 +118,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setCompanyId(companyId);
         prodInOut.setCreatorId(userId);
         prodInOut.setCreateTime(new Date());
+        prodInOut.setPi_date(new Date());
+        prodInOut.setPi_puid(main.getPi_puid());
+        prodInOut.setPi_pucode(main.getPi_pucode());
         //编号获取
         pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id);
         prodInOut.setPi_inoutno(pi_inoutno);
@@ -185,10 +183,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     private void singleDelete(Long id) {
         if (null != id) {
             ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-
             //删除主键
             getMapper().deleteByPrimaryKey(prodInOut.getId());
-
             //删除从表
             ProdIODetailExample prodIODetailExample = new ProdIODetailExample();
             ProdIODetailExample.Criteria cta = prodIODetailExample.createCriteria();
@@ -197,7 +193,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             //更新已转数
 //            updateYqty(prodInOut.getPi_puid(),prodInOut.getPi_class());
             updateYqty(prodInOut);
-
        }
     }
 
@@ -246,11 +241,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Object result =  map.get("result");
         System.out.println("result");
         //记录日志
-
-
         if (!StringUtils.isEmpty(result))
             throw new BizException(500, "存在已审核单据,单据编号:" + result);
-
     }
 
 
@@ -274,29 +266,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     private void updateYqty(ProdInOut prodInOut) {
-
         //更新已转数
         if ("采购验收单".equals(prodInOut.getPi_class())){
             purchasedetailMapper.updatePurchaseYqty(prodInOut.getPi_puid());
         }else if ("采购验退单".equals(prodInOut.getPi_class())){
-            prodIODetailMapper.updatePurchaseYqty(prodInOut.getPi_inid());
+            prodIODetailMapper.updatePurchaseYqty(prodInOut.getPi_puid());
         }
-
-
     }
 
     @Override
     public Result turnProdOut(Long id) {
         ProdInOut sourcePi = getMapper().selectByPrimaryKey(id);
-
         Integer count=0;
         double pdInqty=0, pdYqty=0;
-
-        ProdIODetailExample prodIODetailExample = new ProdIODetailExample();
-        ProdIODetailExample.Criteria cta = prodIODetailExample.createCriteria();
-        cta.andPd_piidEqualTo(id.intValue());
-        List<ProdIODetail> sourcePids =prodIODetailMapper.selectByExample(prodIODetailExample);
-
+        List<ProdIODetail> sourcePids =prodIODetailMapper.selectByFK(id);
         //检查从表
         for (ProdIODetail prodIODetail : sourcePids) {
             pdInqty = prodIODetail.getPd_inqty();
@@ -319,7 +302,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_recorddate(new Date());
         targetPi.setPi_vendcode(sourcePi.getPi_vendcode());
         targetPi.setPi_vendname(sourcePi.getPi_vendname());
-        targetPi.setPi_puid(sourcePi.getId().intValue());
+        targetPi.setPi_puid(sourcePi.getPi_puid());
         targetPi.setPi_pucode(sourcePi.getPi_pucode());
         targetPi.setPi_inid(sourcePi.getId());
 
@@ -329,35 +312,31 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         getMapper().insertSelective(targetPi);
         //插入验退单从表
         long pi_id = targetPi.getId();
-
          for (int i = 0;i<sourcePids.size();i++){
              ProdIODetail sourcePid = sourcePids.get(i);
              ProdIODetail targetPid = new ProdIODetail();
-             targetPid.setPd_piid(pi_id);
-             targetPid.setPd_inoutno(piInoutno);
-             targetPid.setPd_piclass("采购验退单");
-             targetPid.setPd_pdno(i);
-             targetPid.setPd_orderid(sourcePid.getPd_orderid());
-             targetPid.setPd_ordercode(sourcePid.getPd_ordercode());
-             targetPid.setPd_orderdetno(sourcePid.getPd_orderdetno());
-             targetPid.setPd_orderprice(sourcePid.getPd_orderprice());
-             targetPid.setPd_prodid(sourcePid.getPd_prodid());
-             targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
-             targetPid.setPd_ioid(sourcePid.getId());
-             //公司id
-             targetPid.setCompanyId(sourcePid.getCompanyId());
-
-             //本次转单数
-             targetPid.setPd_outqty(sourcePid.getPd_inqty()-sourcePid.getPd_yqty());
-             prodIODetailMapper.insertSelective(targetPid);
-
-             //更新已转数
-             sourcePid.setPd_yqty(sourcePid.getPd_inqty());
-
-             prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
-
+             if(sourcePid.getPd_inqty()-sourcePid.getPd_yqty()>0){
+                 targetPid.setPd_piid(pi_id);
+                 targetPid.setPd_inoutno(piInoutno);
+                 targetPid.setPd_piclass("采购验退单");
+                 targetPid.setPd_pdno(i);
+                 targetPid.setPd_orderid(sourcePid.getPd_orderid());
+                 targetPid.setPd_ordercode(sourcePid.getPd_ordercode());
+                 targetPid.setPd_orderdetno(sourcePid.getPd_orderdetno());
+                 targetPid.setPd_orderprice(sourcePid.getPd_orderprice());
+                 targetPid.setPd_prodid(sourcePid.getPd_prodid());
+                 targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
+                 targetPid.setPd_ioid(sourcePid.getId());
+                 //公司id
+                 targetPid.setCompanyId(sourcePid.getCompanyId());
+                 //本次转单数
+                 targetPid.setPd_outqty(sourcePid.getPd_inqty()-sourcePid.getPd_yqty());
+                 prodIODetailMapper.insertSelective(targetPid);
+                 //更新已转数
+                 sourcePid.setPd_yqty(sourcePid.getPd_inqty());
+                 prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
+             }
          }
-
         return Result.success();
     }
 

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

@@ -307,6 +307,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         if ("TURNIN".equals(acceptstatus)){
             return Result.error(ExceptionCode.TURNIN_EXIST);
         }
+        if ("CLOSED".equals(acceptstatus)){
+            return Result.error(ExceptionCode.CLOSED_EXIST);
+        }
 
         List<PurchaseDetail> purchaseDetails = purchasedetailMapper.selectByFK(id);
 
@@ -349,30 +352,27 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         for (int i=0;i<purchaseDetails.size();i++){
             PurchaseDetail purchaseDetail =purchaseDetails.get(i);
             ProdIODetail prodIODetail = new ProdIODetail();
-            prodIODetail.setPd_piid(pi_id);
-            prodIODetail.setPd_inoutno(piInoutno);
-            prodIODetail.setPd_piclass("采购验收单");
-            prodIODetail.setPd_pdno(i);
-            prodIODetail.setPd_orderid(purchaseDetail.getId().intValue());
-            prodIODetail.setPd_ordercode(purchase.getPu_code());
-            prodIODetail.setPd_orderdetno(purchaseDetail.getPd_detno());
-            prodIODetail.setPd_orderprice(purchaseDetail.getPd_price());
-            prodIODetail.setPd_prodid(purchaseDetail.getPd_prodid());
-            prodIODetail.setPd_prodcode(purchaseDetail.getPd_prodcode());
-            //公司id
-            prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
-
-            //本次转单数
-            prodIODetail.setPd_inqty((int) (purchaseDetail.getPd_qty()-purchaseDetail.getPd_yqty()));
-            prodIODetailMapper.insertSelective(prodIODetail);
-
-            //更新已转数
-            purchaseDetail.setPd_yqty(purchaseDetail.getPd_qty());
-//            getMapper().updateByPrimaryKeySelective(purchase);
-            purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
-
+            if ((int) (purchaseDetail.getPd_qty()-purchaseDetail.getPd_yqty())>0){
+                prodIODetail.setPd_piid(pi_id);
+                prodIODetail.setPd_inoutno(piInoutno);
+                prodIODetail.setPd_piclass("采购验收单");
+                prodIODetail.setPd_pdno(i);
+                prodIODetail.setPd_orderid(purchaseDetail.getId().intValue());
+                prodIODetail.setPd_ordercode(purchase.getPu_code());
+                prodIODetail.setPd_orderdetno(purchaseDetail.getPd_detno());
+                prodIODetail.setPd_orderprice(purchaseDetail.getPd_price());
+                prodIODetail.setPd_prodid(purchaseDetail.getPd_prodid());
+                prodIODetail.setPd_prodcode(purchaseDetail.getPd_prodcode());
+                //公司id
+                prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
+                //本次转单数
+                prodIODetail.setPd_inqty((int) (purchaseDetail.getPd_qty()-purchaseDetail.getPd_yqty()));
+                prodIODetailMapper.insertSelective(prodIODetail);
+                //更新已转数
+                purchaseDetail.setPd_yqty(purchaseDetail.getPd_qty());
+                purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
+            }
         }
-
         //更新主表入库状态
         purchase.setPu_acceptstatus("已入库");
         purchase.setPu_acceptstatuscode("TURNIN");

+ 396 - 45
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -41,6 +41,36 @@
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
     <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <association property="product" javaType="com.usoftchina.saas.document.entities.Product">
+      <id column="pr_id" property="id"/>
+      <result column="pr_code" property="pr_code"/>
+      <result column="pr_detail" property="pr_detail"/>
+      <result column="pr_spec" property="pr_spec"/>
+      <result column="pr_unit" property="pr_unit"/>
+      <result column="pr_kind" property="pr_kind"/>
+      <result column="pr_orispeccode" property="pr_orispeccode"/>
+      <result column="pr_whid" property="pr_whid"/>
+      <result column="pr_whcode" property="pr_whcode"/>
+      <result column="pr_whname" property="pr_whname"/>
+      <result column="pr_zxbzs" property="pr_zxbzs"/>
+      <result column="pr_leadtime" property="pr_leadtime"/>
+      <result column="pr_brand" property="pr_brand"/>
+      <result column="pr_standardprice" property="pr_standardprice"/>
+      <result column="pr_purcprice" property="pr_purcprice"/>
+      <result column="pr_saleprice" property="pr_saleprice"/>
+      <result column="pr_vendid" property="pr_vendid"/>
+      <result column="pr_vendname" property="pr_vendname"/>
+      <result column="pr_vendcode" property="pr_vendcode"/>
+      <result column="pr_docdate" property="pr_docdate"/>
+      <result column="pr_recordmanid" property="pr_recordmanid"/>
+      <result column="pr_recordman" property="pr_recordman"/>
+      <result column="pr_status" property="pr_status"/>
+      <result column="pr_statuscode" property="pr_statuscode"/>
+      <result column="pr_text1" property="pr_text1"/>
+      <result column="pr_text2" property="pr_text2"/>
+      <result column="pr_text3" property="pr_text3"/>
+      <result column="pr_text4" property="pr_text4"/>
+    </association>
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.purchase.po.ProdIODetail">
     <result column="pd_remark" jdbcType="LONGVARCHAR" property="pd_remark" />
@@ -131,11 +161,8 @@
   </select>
   <select id="selectByExample" parameterType="com.usoftchina.saas.purchase.po.ProdIODetailExample" resultMap="BaseResultMap">
     select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from prodiodetail
+        *
+    from prodiodetail a left join product b on a.pd_prodid = b.pr_id and a.companyid = b.companyid
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -198,7 +225,6 @@
     </selectKey>
     insert into prodiodetail
     <trim prefix="(" suffix=")" suffixOverrides=",">
-
       <if test="pd_piid != null">
         pd_piid,
       </if>
@@ -316,11 +342,8 @@
       <if test="pd_ioid != null">
         pd_ioid,
       </if>
-
-
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-
       <if test="pd_piid != null">
         #{pd_piid,jdbcType=INTEGER},
       </if>
@@ -901,58 +924,386 @@
       )
     </foreach>
   </insert>
+
+  <insert id="batchInsert1" parameterType="java.util.List" >
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      insert into prodiodetail
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.pd_piid != null">
+          pd_piid,
+        </if>
+        <if test="item.pd_inoutno != null">
+          pd_inoutno,
+        </if>
+        <if test="item.pd_piclass != null">
+          pd_piclass,
+        </if>
+        <if test="item.pd_pdno != null">
+          pd_pdno,
+        </if>
+        <if test="item.pd_ordercode != null">
+          pd_ordercode,
+        </if>
+        <if test="item.pd_orderdetno != null">
+          pd_orderdetno,
+        </if>
+        <if test="item.pd_prodid != null">
+          pd_prodid,
+        </if>
+        <if test="item.pd_prodcode != null">
+          pd_prodcode,
+        </if>
+        <if test="item.pd_unit != null">
+          pd_unit,
+        </if>
+        <if test="item.pd_inqty != null">
+          pd_inqty,
+        </if>
+        <if test="item.pd_outqty != null">
+          pd_outqty,
+        </if>
+        <if test="item.pd_orderprice != null">
+          pd_orderprice,
+        </if>
+        <if test="item.pd_sendprice != null">
+          pd_sendprice,
+        </if>
+        <if test="item.pd_price != null">
+          pd_price,
+        </if>
+        <if test="item.pd_total != null">
+          pd_total,
+        </if>
+        <if test="item.pd_taxrate != null">
+          pd_taxrate,
+        </if>
+        <if test="item.pd_netprice != null">
+          pd_netprice,
+        </if>
+        <if test="item.pd_nettotal != null">
+          pd_nettotal,
+        </if>
+        <if test="item.pd_whid != null">
+          pd_whid,
+        </if>
+        <if test="item.pd_whcode != null">
+          pd_whcode,
+        </if>
+        <if test="item.pd_whname != null">
+          pd_whname,
+        </if>
+        <if test="item.pd_inwhid != null">
+          pd_inwhid,
+        </if>
+        <if test="item.pd_inwhcode != null">
+          pd_inwhcode,
+        </if>
+        <if test="item.pd_inwhname != null">
+          pd_inwhname,
+        </if>
+        <if test="item.pd_orderid != null">
+          pd_orderid,
+        </if>
+        <if test="item.pd_sdid != null">
+          pd_sdid,
+        </if>
+        <if test="item.pd_status != null">
+          pd_status,
+        </if>
+        <if test="item.companyId != null">
+          companyid,
+        </if>
+        <if test="item.updaterId != null">
+          updaterid,
+        </if>
+        <if test="item.updateTime != null">
+          updatetime,
+        </if>
+        <if test="item.pd_text1 != null">
+          pd_text1,
+        </if>
+        <if test="item.pd_text2 != null">
+          pd_text2,
+        </if>
+        <if test="item.pd_text3 != null">
+          pd_text3,
+        </if>
+        <if test="item.pd_text4 != null">
+          pd_text4,
+        </if>
+        <if test="item.pd_text5 != null">
+          pd_text5,
+        </if>
+        <if test="item.pd_ym != null">
+          pd_ym,
+        </if>
+        <if test="item.pd_yqty != null">
+          pd_yqty,
+        </if>
+        <if test="item.pd_remark != null">
+          pd_remark,
+        </if>
+        <if test="item.pd_ioid != null">
+          pd_ioid,
+        </if>
+      </trim>
+      <trim prefix="values (" suffix=")" suffixOverrides=",">
+        <if test="item.pd_piid != null">
+          #{item.pd_piid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_inoutno != null">
+          #{item.pd_inoutno,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_piclass != null">
+          #{item.pd_piclass,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_pdno != null">
+          #{item.pd_pdno,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_ordercode != null">
+          #{item.pd_ordercode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_orderdetno != null">
+          #{item.pd_orderdetno,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_prodid != null">
+          #{item.pd_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_prodcode != null">
+          #{item.pd_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_unit != null">
+          #{item.pd_unit,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inqty != null">
+          #{item.pd_inqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_outqty != null">
+          #{item.pd_outqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_orderprice != null">
+          #{item.pd_orderprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_sendprice != null">
+          #{item.pd_sendprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_price != null">
+          #{item.pd_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_total != null">
+          #{item.pd_total,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_taxrate != null">
+          #{item.pd_taxrate,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_netprice != null">
+          #{item.pd_netprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_nettotal != null">
+          #{item.pd_nettotal,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_whid != null">
+          #{item.pd_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_whcode != null">
+          #{item.pd_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_whname != null">
+          #{item.pd_whname,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inwhid != null">
+          #{item.pd_inwhid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_inwhcode != null">
+          #{item.pd_inwhcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inwhname != null">
+          #{item.pd_inwhname,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_orderid != null">
+          #{item.pd_orderid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_sdid != null">
+          #{item.pd_sdid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_status != null">
+          #{item.pd_status,jdbcType=INTEGER},
+        </if>
+        <if test="item.companyId != null">
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null">
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null">
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="item.pd_text1 != null">
+          #{item.pd_text1,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text2 != null">
+          #{item.pd_text2,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text3 != null">
+          #{item.pd_text3,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text4 != null">
+          #{item.pd_text4,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text5 != null">
+          #{item.pd_text5,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_ym != null">
+          #{item.pd_ym,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_yqty != null">
+          #{item.pd_yqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_remark != null">
+          #{item.pd_remark,jdbcType=LONGVARCHAR},
+        </if>
+        <if test="item.pd_ioid != null">
+          #{item.pd_ioid,jdbcType=INTEGER},
+        </if>
+      </trim>
+
+    </foreach>
+  </insert>
+
+
+
+
+
+
+
+
+
   <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update prodiodetail <set>
-      pd_piid = #{item.pd_piid},
-      pd_inoutno = #{item.pd_inoutno},
-      pd_piclass = #{item.pd_piclass},
-      pd_pdno = #{item.pd_pdno},
-      pd_ordercode = #{item.pd_orderdetno},
-      pd_orderdetno = #{item.pd_unit},
-      pd_prodid = #{item.pd_prodid},
-      pd_prodcode = #{item.pd_prodcode},
-      pd_unit = #{item.pd_unit},
-      pd_inqty = #{item.pd_inqty},
-      pd_outqty = #{item.pd_outqty},
-      pd_orderprice = #{item.pd_orderprice},
-      pd_sendprice = #{item.pd_sendprice},
-      pd_price = #{item.pd_price},
-      pd_total = #{item.pd_total},
-      pd_taxrate= #{item.pd_taxrate},
-      pd_netprice= #{item.pd_netprice},
-      pd_nettotal= #{item.pd_nettotal},
-      pd_whid= #{item.pd_whid},
-      pd_whcode= #{item.pd_whcode},
-      pd_whname= #{item.pd_whname},
-      pd_inwhid= #{item.pd_inwhid},
-      pd_inwhcode= #{item.pd_inwhcode},
-      pd_inwhname= #{item.pd_inwhname},
-      pd_orderid= #{item.pd_orderid},
-      pd_sdid= #{item.pd_sdid},
-      pd_status= #{item.pd_status},
-      pd_remark= #{item.pd_remark},
-      companyId = #{item.companyId},
-      updaterId = #{item.updaterId},
-      updateTime = #{item.updateTime},
+      <if test="item.pd_piid !=null">
+        pd_piid = #{item.pd_piid},
+      </if>
+      <if test="item.pd_inoutno !=null">
+        pd_inoutno = #{item.pd_inoutno},
+      </if>
+      <if test="item.pd_piclass !=null">
+        pd_piclass = #{item.pd_piclass},
+      </if>
+      <if test="item.pd_pdno !=null">
+        pd_pdno = #{item.pd_pdno},
+      </if>
+      <if test="item.pd_ordercode !=null">
+        pd_ordercode = #{item.pd_ordercode},
+      </if>
+      <if test="item.pd_orderdetno !=null">
+        pd_orderdetno = #{item.pd_orderdetno},
+      </if>
+      <if test="item.pd_prodid !=null">
+        pd_prodid = #{item.pd_prodid},
+      </if>
+      <if test="item.pd_prodcode !=null">
+        pd_prodcode = #{item.pd_prodcode},
+      </if>
+      <if test="item.pd_unit !=null">
+        pd_unit = #{item.pd_unit},
+      </if>
+      <if test="item.pd_inqty !=null">
+        pd_inqty = #{item.pd_inqty},
+      </if>
+      <if test="item.pd_outqty !=null">
+        pd_outqty = #{item.pd_outqty},
+      </if>
+      <if test="item.pd_orderprice !=null">
+        pd_orderprice = #{item.pd_orderprice},
+      </if>
+      <if test="item.pd_sendprice !=null">
+        pd_sendprice = #{item.pd_sendprice},
+      </if>
+      <if test="item.pd_price !=null">
+        pd_price = #{item.pd_price},
+      </if>
+      <if test="item.pd_total !=null">
+        pd_total = #{item.pd_total},
+      </if>
+      <if test="item.pd_taxrate !=null">
+        pd_taxrate = #{item.pd_taxrate},
+      </if>
+      <if test="item.pd_netprice !=null">
+        pd_netprice = #{item.pd_netprice},
+      </if>
+      <if test="item.pd_nettotal !=null">
+        pd_nettotal = #{item.pd_nettotal},
+      </if>
+      <if test="item.pd_whid !=null">
+        pd_whid = #{item.pd_whid},
+      </if>
+      <if test="item.pd_whcode !=null">
+        pd_whcode = #{item.pd_whcode},
+      </if>
+      <if test="item.pd_whname !=null">
+        pd_whname = #{item.pd_whname},
+      </if>
+      <if test="item.pd_inwhid !=null">
+        pd_inwhid = #{item.pd_inwhid},
+      </if>
+      <if test="item.pd_inwhcode !=null">
+        pd_inwhcode = #{item.pd_inwhcode},
+      </if>
+      <if test="item.pd_inwhname !=null">
+        pd_inwhname = #{item.pd_inwhname},
+      </if>
+      <if test="item.pd_orderid !=null">
+        pd_orderid = #{item.pd_orderid},
+      </if>
+      <if test="item.pd_sdid !=null">
+        pd_sdid = #{item.pd_sdid},
+      </if>
+      <if test="item.pd_status !=null">
+        pd_status = #{item.pd_status},
+      </if>
+      <if test="item.pd_remark !=null">
+        pd_remark = #{item.pd_remark},
+      </if>
+      <if test="item.companyId!=null">
+        companyId = #{item.companyId},
+      </if>
+      <if test="item.updaterId!=null">
+        updaterId = #{item.updaterId},
+      </if>
+      <if test="item.updateTime!=null">
+        updateTime = #{item.updateTime},
+      </if>
       pd_text1 = #{item.pd_text1},
       pd_text2 = #{item.pd_text2},
       pd_text3 = #{item.pd_text3},
       pd_text4 = #{item.pd_text4},
       pd_text5 = #{item.pd_text5},
-      pd_ym = #{item.pd_ym},
-      pd_yqty = #{item.pd_yqty}
+      <if test="item.pd_ym!=null">
+        pd_ym = #{item.pd_ym},
+      </if>
+      <if test="item.pd_yqty!=null">
+        pd_yqty = #{item.pd_yqty},
+      </if>
     </set>
       where PD_ID = #{item.id,jdbcType=INTEGER}
     </foreach>
   </update>
 
-  <update id="updatePurchaseYqty" parameterType="java.lang.Long">
+  <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
 
 update prodiodetail a
-set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_outqty,pd_ioid from prodiodetail where pd_piclass='采购验退单') b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
-where a.pd_piid = #{id,jdbcType=INTEGER}
+set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_ioid,sum(pd_outqty) pd_outqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
+and pi_puid=#{id,jdbcType=INTEGER}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
   </update>
 
 
+  <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
+    select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
+    where pd_piid=#{id} order by pd_pdno
+  </select>
+
+
+
 </mapper>

+ 4 - 1
framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java

@@ -43,7 +43,10 @@ public enum ExceptionCode implements BaseExceptionCode {
     FILE_FOLDER_NULL(55502, "文件夹为空"),
 
     TURNIN_EXIST(60000,"已入库"),
-    TURNINNUM_NOT_EXIST(60001,"无可转数")
+    TURNINNUM_NOT_EXIST(60001,"无可转数"),
+
+    CLOSED_EXIST(60002,"已关闭")
+
     ;
 
     private int code;

+ 7 - 0
frontend/saas-web/app/model/document/product.js

@@ -0,0 +1,7 @@
+Ext.define('saas.model.document.product', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'pr_detail', type: 'string' },
+        { name: 'pr_unit', type: 'string' }
+    ]
+});

+ 18 - 0
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -0,0 +1,18 @@
+Ext.define('saas.model.purchase.purchasedetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pd_detno', type: 'int' },
+        { name: 'id', type: 'int' },
+        { name: 'pd_prodcode', type: 'string' },
+        { name: 'pd_qty', type: 'int' },
+        { name: 'pd_yqty', type: 'int' },
+        { name: 'pd_price', type: 'float' },
+        { name: 'pd_taxrate', type: 'float' },
+        { name: 'pd_total', type: 'float' },
+        { name: 'pd_delivery', type: 'date' },
+        { name: 'pd_taxtotal', type: 'float' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.product', associationKey: 'product'}]
+});

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

@@ -69,23 +69,11 @@ Ext.define('saas.util.FormUtil', {
                             formModel.set('_detailBindFields', cnames);
                             item.bind = {
                                 store: '{_detailStore}'
-                            };       
+                            };     
                             formModel.set('_detailStore', Ext.create('Ext.data.Store', {
-                                fields: item.columns ? item.columns.filter(function(c) {
-                                    return !!c.dataIndex;
-                                }).map(function(c) {
-                                    var type = "string";
-                                    if(c.xtype!=""){
-                                        if(c.xtype=="numbercolumn"){
-                                            type = "float"
-                                        }
-                                    }
-                                    return {name: c.dataIndex,type:type};
-                                }) : [],
+                                model:item.storeModel,
                                 data: []
                             }));
-
-
                         }
                     });
                 }

+ 6 - 1
frontend/saas-web/app/view/auth/Login.js

@@ -5,6 +5,10 @@ Ext.define('saas.view.auth.Login', {
     extend: 'Ext.container.Container',
     xtype: 'login',
 
+    requires: [
+        'Ext.form.Label'
+    ],
+
     controller: 'login',
 
     cls: 'auth-login',
@@ -36,7 +40,8 @@ Ext.define('saas.view.auth.Login', {
             },
             items: [
                 {
-                    html: '账 户 登 录'
+                    xtype: 'label',
+                    text: '账 户 登 录'
                 },
                 {
                     xtype: 'textfield',

+ 5 - 3
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -127,11 +127,13 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     },
 
     judge:function(f){
-        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1){
+            f.belong = 'query';
+            return f.ownerCt.ownerCt
+        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
             f.belong = 'form';
             return f.ownerCt
-        }
-        else if(f.column){
+        }else if(f.column){
             f.belong = 'grid';
             return f.column.ownerCt.ownerCt.ownerCt
         }

+ 5 - 3
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -166,11 +166,13 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     },
 
     judge:function(f){
-        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1){
+            f.belong = 'query';
+            return f.ownerCt.ownerCt
+        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
             f.belong = 'form';
             return f.ownerCt
-        }
-        else if(f.column){
+        }else if(f.column){
             f.belong = 'grid';
             return f.column.ownerCt.ownerCt.ownerCt
         }

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

@@ -39,6 +39,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var me = this;
         var form = this.getView();
         var id = form.getForm().findField(form._idField);
+        var code = form.getForm().findField(form._codeField);
         if(id&&id.value!=0){
             me.BaseUtil.request({
                 url: form._deleteUrl+id.value,

+ 2 - 5
frontend/saas-web/app/view/core/tab/Controller.js

@@ -6,13 +6,10 @@ Ext.define('saas.view.core.tab.Controller', {
         var me = this,
         tab = me.getView(),
         tabConfig = tab.tabViewConfig,
-        type = tabConfig.type,
-        viewType = type == 'form' ? tabConfig.formtype : tabConfig.querytype;
+        viewtype = tabConfig.viewtype;
 
-        console.log(viewType);
-        
         tab.add({
-            xtype: viewType
+            xtype:viewtype
         });
     },
 

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

@@ -7,6 +7,9 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
     layout: 'fit',
     modal: true,
     width: 400,
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     height: 220,
     listeners:{
       show:function(w){
@@ -40,10 +43,10 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         vendorkind:{
             items:[{
                 xtype:'hidden',
-                name:'vk_id'
+                name:'id'
             },{
                 xtype:'textfield',
-                name:'vk_kind',
+                name:'vk_name',
                 allowBlank:false,
                 fieldLabel:'类型'
             }],
@@ -91,15 +94,37 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         return Ext.apply(conf, me.etc[kind]);
     },
     onSave:function(){
-
+        var belong = this.belong;
         var form=this.down('form');
-        alert('save');
+        var dataField = form.down('[name='+belong.dataField+']');
+        if(!dataField.value){
+             Ext.Msg.alert('提示','数据有误');
+            return false;
+        }
+        var keyField = form.down('[name='+belong.keyField+']');
+        //保存接口
+        var params = {};
+        params[belong.dataField] = dataField.value;
+        params[belong.keyField] = keyField.value || 0;
+        this.BaseUtil.request({
+            url: belong.reqUrl,
+            params: JSON.stringify(params),
+            method: 'POST',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','保存成功');
+                var grid = form.ownerCt._parent.lookup('document-kind-Grid');
+                grid.store.load();
+                form.ownerCt.close();
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','保存失败');
+        });
     },
     onCancel:function(){
-        alert('cancel');
         this.hide();
-    },
-
-
-
+    }
 });

+ 7 - 3
frontend/saas-web/app/view/document/kind/Kind.js

@@ -4,6 +4,8 @@
 Ext.define('saas.view.document.kind.Kind', {
     extend: 'Ext.panel.Panel',
     xtype: 'document-kind',
+    autoScroll: true,
+    layout:'fit',
     controller:'document-kind',
     viewModel: {
         type: 'document-kind'
@@ -78,11 +80,13 @@ Ext.define('saas.view.document.kind.Kind', {
         vendorkind:{
             columns: [{
                 text: '供应商类型',
-                dataIndex: 'vk_kind',
+                dataIndex: 'vk_name',
                 flex: 1
             }],
-            keyField:'vk_id',
-            reqUrl:''
+            keyField:'id',
+            dataField:'vk_name',
+            reqUrl:'http://192.168.253.41:9480/api/document/vendorkind/save',
+            delUrl:'http://192.168.253.41:9480/api/document/vendorkind/delete'
         },
         productkind:{
             columns: [{

+ 23 - 2
frontend/saas-web/app/view/document/kind/KindController.js

@@ -4,12 +4,16 @@
 Ext.define('saas.view.document.kind.KindController', {
     extend: 'Ext.app.ViewController',
     alias: 'controller.document-kind',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     loadDefualt:function(grid){
         var me=this,
             view = me.getView(),
             vm = me.getViewModel(),
             defaultKind=vm.getData()['dataKind'].value,
             etc = view.etc[defaultKind];
+
         grid.reconfigure(vm.getStore(defaultKind), me.insertActionColumn(etc.columns));
     },
     onKindToggle:function(container, button, pressed){
@@ -20,6 +24,7 @@ Ext.define('saas.view.document.kind.KindController', {
             vm = me.getViewModel(),
             etc = view.etc[name],
             store=vm.getStore(name);
+
        var columns=me.insertActionColumn(etc.columns);
         grid.reconfigure(store, columns);
         if(store) store.reload();
@@ -68,11 +73,25 @@ Ext.define('saas.view.document.kind.KindController', {
             dataKind=me.getViewModel().getData()['dataKind'].value;
         rec = grid.getStore().getAt(row);
         var keyV=rec.get(view.etc[dataKind].keyField);
-        alert('删除ID:'+keyV);
+        //删除接口
+        this.BaseUtil.request({
+            url: view.etc[dataKind].delUrl,
+            params: {id:keyV},
+            method: 'POST'
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','删除成功');
+                grid.store.load();
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','删除失败');
+        });
     },
     createDialog: function(dataKind,record) {
         var view = this.getView();var me=this;
-
         this.isEdit = !!record;
         this.dialog = view.add({
             xtype: 'document-kind-childwin',
@@ -80,6 +99,8 @@ Ext.define('saas.view.document.kind.KindController', {
                 title: record ? '修改{title}类型' : '新增{title}类型'
             },
             dataKind:dataKind,
+            belong:this.getView().etc[dataKind],
+            _parent:this.getView(),
             record:record,
             session: true
         });

+ 8 - 4
frontend/saas-web/app/view/document/kind/KindModel.js

@@ -26,14 +26,18 @@ Ext.define('saas.view.document.kind.KindModel', {
         },
         vendorkind:{
             fields:[
-                {name: 'vk_id', type: 'int'},
-                {name: 'vk_kind',  type: 'string'}
+                {name: 'id', type: 'int'},
+                {name: 'vk_name',  type: 'string'}
             ],
             proxy: {
                 type: 'ajax',
-                url: 'resources/json/vendor.json',
+                url: 'http://192.168.253.41:9480/api/document/vendorkind/getAll',
+                actionMethods: {
+                    read: 'GET'
+                },
                 reader: {
-                    type: 'json'
+                    type: 'json',
+                    rootProperty: 'data'
                 }
             },
             pageSize: null,

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

@@ -3,7 +3,8 @@ Ext.define('saas.view.main.Main', {
     xtype: 'main',
 
     requires: [
-        'Ext.list.Tree'
+        'Ext.list.Tree',
+        'Ext.Img'
     ],
     
     controller: 'main',

+ 4 - 0
frontend/saas-web/app/view/main/MainContainerWrap.js

@@ -2,6 +2,10 @@ Ext.define('saas.view.main.MainContainerWrap', {
     extend: 'Ext.container.Container',
     xtype: 'maincontainerwrap',
 
+    requires: [
+        'Ext.tab.Panel'
+    ],
+
     id: 'main-view-detail-wrap',
     flex: 1,
 

+ 0 - 552
frontend/saas-web/app/view/main/MainModel.js

@@ -8,557 +8,5 @@ Ext.define('saas.view.main.MainModel', {
 
     data: {
         
-    },
-
-    stores: {
-        navItems: {
-            type: 'tree',
-            root: {
-                expanded: true,
-                children: [
-                    {
-                        id: 'gh',
-                        text: '购货',
-                        iconCls: 'x-fa fa-shopping-basket',
-                        children: [
-                            {
-                                id: 'cgdj',
-                                text: '采购单据',
-                                children: [
-                                    {
-                                        id: 'purchaseOrder',
-                                        text: '采购单(维护界面)',
-                                        viewType:'purchase-purchase-formpanel',
-                                        leaf: true
-                                    },{
-                                        id: 'purchaseQuery',
-                                        text: '采购单查询',
-                                        viewType:'purchase-purchase-querypanel',
-                                        leaf: true
-                                    },{
-                                        id: 'purchaseInOrder',
-                                        text: '采购验收单(维护界面)',
-                                        viewType:'purchase-purchaseIn-formpanel',
-                                        leaf: true
-                                    },{
-                                        id: 'purchaseInQuery',
-                                        text: '采购验收单查询',
-                                        viewType:'purchase-purchaseIn-querypanel',
-                                        leaf: true
-                                    },{
-                                        id: 'purchaseOutOrder',
-                                        text: '采购验退单(维护界面)',
-                                        viewType:'purchase-purchaseOut-formpanel',
-                                        leaf: true
-                                    },{
-                                        id: 'purchaseOutQuery',
-                                        text: '采购验退单查询',
-                                        viewType:'purchase-purchaseOut-querypanel',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'form1',
-                                        text: '测试-采购单明细界面',
-                                        viewType: 'test-order-formpanel',
-                                        leaf: true
-                                    }, {
-                                        id: 'myform',
-                                        text: '测试-明细界面',
-                                        viewType: 'test-myform-formpanel',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'myquerytest',
-                                        text: '测试-采购单查询界面',
-                                        viewType: 'test-query-querypanel',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'ghdd',
-                                        text: '购货订单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'ghd',
-                                        text: '购货单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'ghthd',
-                                        text: '购货退货单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'yxdgkb',
-                                        text: '以销定购看板',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        id: 'znbh',
-                                        text: '智能补货',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            },
-                            {
-                                text: '采购报表',
-                                children: [
-                                    {
-                                        text: '采购订单跟踪表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '采购明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '采购汇总表(按商品)',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '采购汇总表(按供应商)',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '采购付款一览表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        text: '销货',
-                        iconCls: 'x-fa fa-shopping-cart',
-                        children: [
-                            {
-                                text: '销售单据',
-                                children: [
-                                    {
-                                        text: '销货订单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销货单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销货退货单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '原始单据',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售开票',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            },
-                            {
-                                text: '销售报表',
-                                children: [
-                                    {
-                                        text: '销售订单跟踪表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售汇总表(按商品)',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售汇总表(按客户)',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售汇总表(按销售人员)',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售收款一览表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '往来单位欠款表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售利润表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '销售排行表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        text: '仓库',
-                        iconCls: 'x-fa fa-archive',
-                        children: [
-                            {
-                                text: '仓库单据',
-                                children: [
-                                    {
-                                        text: '调拨单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '盘点',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '盘点记录',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '序列号盘点',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '其他入库单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '其他出库单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '成本调整单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '组装单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '拆卸单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            },
-                            {
-                                text: '仓库报表',
-                                children: [
-                                    {
-                                        text: '商品库存余额表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '商品收发明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '商品收发汇总表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '序列号跟踪表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '序列号状态表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '批次保质期清单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '批次跟踪表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        text: '资金',
-                        iconCls: 'x-fa fa-credit-card',
-                        children: [
-                            {
-                                text: '资金单据',
-                                children: [
-                                    {
-                                        text: '收款单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '付款单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '核销单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '其他收入单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '其他支出单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '采购销售费用清单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '资金转账单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            },
-                            {
-                                text: '资金报表',
-                                children: [
-                                    {
-                                        text: '现金银行报表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '应收账款明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '应付账款明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '客户对账单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '供应商对账单',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '其他收支明细表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '利润表',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        text: '资料',
-                        iconCls: 'x-fa fa-book',
-                        children: [
-                            {
-                                text: '基础资料',
-                                children: [
-                                    {
-                                        text: '客户资料',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '供应商管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '商品管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '仓库管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '职员管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '账户管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '发货地址管理',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '新手导航',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            },
-                            {
-                                text: '辅助资料',
-                                children: [
-                                    {
-                                        text: '客户类别',
-                                        viewType: 'document-kind',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '供应商类别',
-                                        viewType: 'document-kind',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '商品类别',
-                                        viewType: 'document-kind',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '支出类别',
-                                        viewType: 'document-kind',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '收入类别',
-                                        viewType: 'document-kind',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '计量单位',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '结算方式',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '辅助属性',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '客户物料编码',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    },
-                                    {
-                                        text: '单据编码规则',
-                                        viewType: 'mainlist',
-                                        leaf: true
-                                    }
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        text: '设置',
-                        iconCls: 'x-fa fa-cog',
-                        children: [
-                            {
-                                text: '系统参数',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '权限设置',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '操作日志',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '套打模板',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '备份与恢复',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '结账/反结账',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '重算成本',
-                                viewType: 'mainlist',
-                                leaf: true
-                            },
-                            {
-                                text: '增值服务',
-                                viewType: 'mainlist',
-                                leaf: true
-                            }
-                        ]
-                    }
-                ]
-            }
-        }
     }
 });

+ 245 - 228
frontend/saas-web/app/view/main/Navigation.js

@@ -8,10 +8,10 @@ Ext.define('saas.view.main.Navigation', {
     navCollapsed: false,
     cls: 'x-navpanel',
 
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         var view = new Ext.DataView({
-            store : Ext.create('Ext.data.Store', {
+            store: Ext.create('Ext.data.Store', {
                 fields: ['text', 'iconCls'],
                 data: [{
                     text: '采购',
@@ -19,40 +19,40 @@ Ext.define('saas.view.main.Navigation', {
                     items: [{
                         text: '制单',
                         items: [{
-                            id: 'purchase',
-                            text: '采购单',
-                            formType:'purchase-purchase-formpanel',
-                            queryType: 'purchase-purchase-querypanel'
-                        }, {
-                            id: 'purchaseIn',
-                            text: '采购验收单',
-                            formType:'purchase-purchaseIn-formpanel',
-                            queryType: 'purchase-purchaseIn-querypanel'
-                        },{
-                            id: 'purchaseOut',
-                            text: '采购验退单',
-                            formType:'purchase-purchaseOut-formpanel',
-                            queryType: 'purchase-purchaseOut-querypanel'
-                        },{
-                            id: 'inquiry',
-                            text: '采购询价单',
-                            formType:'purchase-inquiry-formpanel',
-                            queryType: 'purchase-inquiry-querypanel'
-                        }
-                        // ,{
-                        //     id: 'form1',
-                        //     text: '测试-采购单明细界面',
-                        //     formType: 'test-order-formpanel'
-                        // }, {
-                        //     id: 'myform',
-                        //     text: '测试-明细界面',
-                        //     formType: 'test-myform-formpanel'
-                        // }, {
-                        //     id: 'myquerytest',
-                        //     text: '测试-采购单查询界面',
-                        //     queryType: 'test-query-querypanel',
-                        // }
-                    ]
+                                id: 'purchase',
+                                text: '采购单',
+                                addType: 'purchase-purchase-formpanel',
+                                viewType: 'purchase-purchase-querypanel'
+                            }, {
+                                id: 'purchaseIn',
+                                text: '采购验收单',
+                                addType: 'purchase-purchaseIn-formpanel',
+                                viewType: 'purchase-purchaseIn-querypanel'
+                            }, {
+                                id: 'purchaseOut',
+                                text: '采购验退单',
+                                addType: 'purchase-purchaseOut-formpanel',
+                                viewType: 'purchase-purchaseOut-querypanel'
+                            }, {
+                                id: 'inquiry',
+                                text: '采购询价单',
+                                formType: 'purchase-inquiry-formpanel',
+                                queryType: 'purchase-inquiry-querypanel'
+                            }
+                            // ,{
+                            //     id: 'form1',
+                            //     text: '测试-采购单明细界面',
+                            //     formType: 'test-order-formpanel'
+                            // }, {
+                            //     id: 'myform',
+                            //     text: '测试-明细界面',
+                            //     formType: 'test-myform-formpanel'
+                            // }, {
+                            //     id: 'myquerytest',
+                            //     text: '测试-采购单查询界面',
+                            //     queryType: 'test-query-querypanel',
+                            // }
+                        ]
                     }, {
                         text: '报表',
                         items: [{
@@ -69,31 +69,31 @@ Ext.define('saas.view.main.Navigation', {
                         items: [{
                             id: 'sale',
                             text: '销售订单',
-                            formType:'sale-sale-formpanel',
+                            formType: 'sale-sale-formpanel',
                             queryType: 'sale-sale-querypanel'
-                        },{
+                        }, {
                             id: 'saleOut',
                             text: '销售出货单',
-                            formType:'sale-saleOut-formpanel',
+                            formType: 'sale-saleOut-formpanel',
                             queryType: 'sale-saleOut-querypanel'
-                        },{
+                        }, {
                             id: 'saleIn',
                             text: '销售退货单',
-                            formType:'sale-saleIn-formpanel',
+                            formType: 'sale-saleIn-formpanel',
                             queryType: 'sale-saleIn-querypanel'
-                        },{
+                        }, {
                             id: 'saleToPur',
                             text: '以销定购',
-                            formType:'sale-saleToPur-formpanel',
+                            formType: 'sale-saleToPur-formpanel',
                             queryType: 'sale-saleToPur-querypanel'
                         }]
                     }, {
                         text: '报表',
                         items: [{
                             text: '销售明细表'
-                        },{
+                        }, {
                             text: '销售收款一览表'
-                        },{
+                        }, {
                             text: '销售利润表'
                         }]
                     }]
@@ -105,36 +105,36 @@ Ext.define('saas.view.main.Navigation', {
                         items: [{
                             id: 'appropriationInOut',
                             text: '调拨单',
-                            formType:'stock-appropriationInOut-formpanel',
+                            formType: 'stock-appropriationInOut-formpanel',
                             queryType: 'stock-appropriationInOut-querypanel'
-                        },{
+                        }, {
                             id: 'make',
                             text: '制造单',
-                            formType:'stock-make-formpanel',
+                            formType: 'stock-make-formpanel',
                             queryType: 'stock-make-querypanel'
-                        },{
+                        }, {
                             id: 'otherIn',
                             text: '其它入库单',
-                            formType:'stock-otherIn-formpanel',
+                            formType: 'stock-otherIn-formpanel',
                             queryType: 'stock-otherIn-querypanel'
-                        },{
+                        }, {
                             id: 'otherOut',
                             text: '其它出库单',
-                            formType:'stock-otherOut-formpanel',
+                            formType: 'stock-otherOut-formpanel',
                             queryType: 'stock-otherOut-querypanel'
-                        },{
+                        }, {
                             id: 'inventory',
                             text: '盘点单',
-                            formType:'stock-inventory-formpanel',
+                            formType: 'stock-inventory-formpanel',
                             queryType: 'stock-inventory-querypanel'
                         }]
                     }, {
                         text: '报表',
                         items: [{
                             text: '物料出入库明细表'
-                        },{
+                        }, {
                             text: '物料收发汇总表'
-                        },{
+                        }, {
                             text: '物料库存数量金额表'
                         }]
                     }]
@@ -146,146 +146,163 @@ Ext.define('saas.view.main.Navigation', {
                         items: [{
                             id: 'payBalance',
                             text: '付款单',
-                            formType:'money-payBalance-formpanel',
+                            formType: 'money-payBalance-formpanel',
                             queryType: 'money-payBalance-querypanel'
-                        },{
+                        }, {
                             id: 'recBbalance',
                             text: '收款单',
-                            formType:'money-recBbalance-formpanel',
+                            formType: 'money-recBbalance-formpanel',
                             queryType: 'money-recBbalance-querypanel'
-                        },{
+                        }, {
                             id: 'verification',
                             text: '核销单',
-                            formType:'money-verification-formpanel',
+                            formType: 'money-verification-formpanel',
                             queryType: 'money-verification-querypanel'
-                        },{
+                        }, {
                             id: 'othReceipts',
                             text: '其它收支单',
-                            formType:'money-othReceipts-formpanel',
+                            formType: 'money-othReceipts-formpanel',
                             queryType: 'money-othReceipts-querypanel'
-                        },{
+                        }, {
                             id: 'fundTransfer',
                             text: '资金转存',
-                            formType:'money-fundTransfer-formpanel',
+                            formType: 'money-fundTransfer-formpanel',
                             queryType: 'money-fundTransfer-querypanel'
                         }]
                     }, {
                         text: '报表',
                         items: [{
                             text: '供应商对账单'
-                        },{
+                        }, {
                             text: '应付账款明细表'
-                        },{
+                        }, {
                             text: '客户对账单'
-                        },{
+                        }, {
                             text: '应收款明细表'
-                        },{
+                        }, {
                             text: '资金账户余额表'
                         }]
                     }]
                 }, {
                     text: '资料',
-                    iconCls: 'x-fa fa-shopping-cart',
+                    iconCls: 'x-fa fa-book',
                     items: [{
-                        text: '基础资料',
-                        items: [{
-                            id: 'vendor',
-                            text: '供应商资料',
-                            formType:'document-vendor-formpanel',
-                            queryType: 'document-vendor-querypanel'
-                        },{
-                            id: 'customer',
-                            text: '客户资料',
-                            formType:'document-customer-formpanel',
-                            queryType: 'document-customer-querypanel'
-                        },{
-                            id: 'product',
-                            text: '物料资料',
-                            formType:'document-product-formpanel',
-                            queryType: 'document-product-querypanel'
-                        },{
-                            id: 'warehouse',
-                            text: '仓库资料',
-                            formType:'document-warehouse-formpanel',
-                            queryType: 'document-warehouse-querypanel'
-                        },{
-                            id: 'bom',
-                            text: 'BOM资料',
-                            formType:'document-bom-formpanel',
-                            queryType: 'document-bom-querypanel'
-                        },{
-                            id: 'moneyAccount',
-                            text: '资金账户',
-                            formType:'document-moneyAccount-formpanel',
-                            queryType: 'document-moneyAccount-querypanel'
-                        },{
-                            id: 'employee',
-                            text: '人员资料',
-                            formType:'document-employee-formpanel',
-                            queryType: 'document-employee-querypanel'
-                        }]
-                    }, {
-                        text: '辅助资料',
-                        items: [{
-                            id: 'vendorType',
-                            text: '供应商类型',
-                            formType:'document-vendorType-formpanel',
-                            queryType: 'document-vendorType-querypanel'
-                        },{
-                            id: 'purcAddress',
-                            text: '采购交货地址',
-                            formType:'document-purcAddress-formpanel',
-                            queryType: 'document-purcAddress-querypanel'
-                        },{
-                            id: 'customerType',
-                            text: '客户类型',
-                            formType:'document-customerType-formpanel',
-                            queryType: 'document-customerType-querypanel'
-                        },{
-                            id: 'unit',
-                            text: '计量单位',
-                            formType:'document-unit-formpanel',
-                            queryType: 'document-unit-querypanel'
-                        },{
-                            id: 'productType',
-                            text: '物料类型',
-                            formType:'document-productType-formpanel',
-                            queryType: 'document-productType-querypanel'
-                        },{
-                            id: 'productBrand',
-                            text: '物料品牌',
-                            formType:'document-productBrand-formpanel',
-                            queryType: 'document-productBrand-querypanel'
-                        },{
-                            id: 'moneyinoutType',
-                            text: '收支类别',
-                            formType:'document-moneyinoutType-formpanel',
-                            queryType: 'document-moneyinoutType-querypanel'
-                        },{
-                            id: 'role',
-                            text: '用户角色',
-                            formType:'document-role-formpanel',
-                            queryType: 'document-role-querypanel'
-                        }]
-                    }]
-                }],
+                            text: '基础资料',
+                            items: [{
+                                    text: '客户资料',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '供应商管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '商品管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '仓库管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '职员管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '账户管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '发货地址管理',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '新手导航',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                }
+                            ]
+                        },
+                        {
+                            text: '辅助资料',
+                            items: [{
+                                    text: '客户类别',
+                                    viewType: 'document-kind',
+                                    leaf: true
+                                },
+                                {
+                                    text: '供应商类别',
+                                    viewType: 'document-kind',
+                                    leaf: true
+                                },
+                                {
+                                    text: '商品类别',
+                                    viewType: 'document-kind',
+                                    leaf: true
+                                },
+                                {
+                                    text: '支出类别',
+                                    viewType: 'document-kind',
+                                    leaf: true
+                                },
+                                {
+                                    text: '收入类别',
+                                    viewType: 'document-kind',
+                                    leaf: true
+                                },
+                                {
+                                    text: '计量单位',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '结算方式',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '辅助属性',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '客户物料编码',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                },
+                                {
+                                    text: '单据编码规则',
+                                    viewType: 'mainlist',
+                                    leaf: true
+                                }
+                            ]
+                        }
+                    ]
+                }]
             }),
-            tpl : new Ext.XTemplate('<ul class="x-navlist">',
+            tpl: new Ext.XTemplate('<ul class="x-navlist">',
                 '<tpl for=".">',
                 '<li class="x-navitem">',
-                    '<div class="x-navitem-body">',
-                        '<div class="nav-inner-wrap" style="margin-left: 0px;">',
-                        '<div class="nav-inner-icon {iconCls}"></div>',
-                        '<div class="nav-inner-text">{text}</div>',
-                    '</div>',
+                '<div class="x-navitem-body">',
+                '<div class="nav-inner-wrap" style="margin-left: 0px;">',
+                '<div class="nav-inner-icon {iconCls}"></div>',
+                '<div class="nav-inner-text">{text}</div>',
+                '</div>',
                 '</li>',
                 '</tpl>',
-            '</ul>'),
+                '</ul>'),
             trackOver: true,
-            overItemCls : 'x-navitem-over',
-            selectedClass : 'x-navitem-selected',
-            singleSelect : true,
-            itemSelector : '.x-navitem',
+            overItemCls: 'x-navitem-over',
+            selectedClass: 'x-navitem-selected',
+            singleSelect: true,
+            itemSelector: '.x-navitem',
             listeners: {
                 itemmouseenter: me.showNavMenu,
                 itemmouseleave: me.hideNavMenu,
@@ -302,97 +319,97 @@ Ext.define('saas.view.main.Navigation', {
         me.callParent();
     },
 
-    clickNavMenu: function(view, record, item, index, e, eOpts) {
+    clickNavMenu: function (view, record, item, index, e, eOpts) {
         var me = this;
         this.showNavMenu(view, record, item, index, e, eOpts);
     },
 
-    showNavMenu: function(view, record, item, index, e, eOpts) {
+    showNavMenu: function (view, record, item, index, e, eOpts) {
         var recData = record.data,
-        menuItems = recData.items || [],
-        itemBox = item.getBoundingClientRect(),
-        pos = [itemBox.left + itemBox.width, itemBox.top],
-        id = recData.id,
-        menuId = 'navMenu-' + id,
-        menu = Ext.getCmp(menuId);
+            menuItems = recData.items || [],
+            itemBox = item.getBoundingClientRect(),
+            pos = [itemBox.left + itemBox.width, itemBox.top],
+            id = recData.id,
+            menuId = 'navMenu-' + id,
+            menu = Ext.getCmp(menuId);
 
-        if(!menu) {
+        if (!menu) {
             var view = new Ext.DataView({
-                store : Ext.create('Ext.data.Store', {
-                   fields: ['id', 'text', 'formType', 'queryType'],
-                   data: menuItems
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['id', 'text', 'addType', 'viewType'],
+                    data: menuItems
                 }),
                 tpl: new Ext.XTemplate('<div class="x-navitem-menu">',
                     '<div class="nav-menu-body">',
-                        '<tpl for=".">',
-                        '<div class="menu">',
-                            '<h3 class="menu-title">{text}</h3>',
-                            '<div class="menu-content">',
-                                '<tpl for="items">',
-                                '<div class="menuitem">',
-                                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-queryType="{queryType}">',
-                                        '{text}',
-                                    '</div>',
-                                    '<tpl if="{formType}">',
-                                    '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-formType="{formType}">新增</div>',
-                                    '</tpl>',
-                                '</div>',
-                                '</tpl>',
-                            '</div>',
-                        '</div>',
-                        '</tpl>',
+                    '<tpl for=".">',
+                    '<div class="menu">',
+                    '<h3 class="menu-title">{text}</h3>',
+                    '<div class="menu-content">',
+                    '<tpl for="items">',
+                    '<div class="menuitem">',
+                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
+                    '{text}',
+                    '</div>',
+                    '<tpl if="{addType}">',
+                    '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-viewType="{addType}">新增</div>',
+                    '</tpl>',
+                    '</div>',
+                    '</tpl>',
                     '</div>',
-                '</div>'),
+                    '</div>',
+                    '</tpl>',
+                    '</div>',
+                    '</div>'),
                 trackOver: true,
-                overItemCls : 'menuitem-over',
-                selectedClass : 'menuitem-selected',
-                singleSelect : true,
-                itemSelector : 'menu',
+                overItemCls: 'menuitem-over',
+                selectedClass: 'menuitem-selected',
+                singleSelect: true,
+                itemSelector: 'menu',
                 listeners: {
-                    boxready: function(view, width, height, eOpts) {
+                    boxready: function (view, width, height, eOpts) {
                         var menu = view.up('menu'),
-                        menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
-                        menuBox = menuView.getBoundingClientRect(),
-                        menuViewWidth = menuBox.width,
-                        menuViewHeight = menuBox.height,
-                        menuItem = menuView.getElementsByClassName('menuitem');
-                        
+                            menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
+                            menuBox = menuView.getBoundingClientRect(),
+                            menuViewWidth = menuBox.width,
+                            menuViewHeight = menuBox.height,
+                            menuItem = menuView.getElementsByClassName('menuitem');
+
                         menu.setWidth(menuViewWidth);
                         menu.setHeight(menuViewHeight);
                         menu.updateLayout();
 
-                        view.el.dom.addEventListener('mouseleave', function(e) {
+                        view.el.dom.addEventListener('mouseleave', function (e) {
                             var ex = e.clientX,
-                            ey = e.clientY,
-                            box = menuView.getBoundingClientRect();
+                                ey = e.clientY,
+                                box = menuView.getBoundingClientRect();
 
-                            if(ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && ey >= (box.top + 64))) {
+                            if (ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && ey >= (box.top + 64))) {
                                 menu.hide();
                             }
                         });
 
-                        Ext.Array.each(menuItem, function(mi) {
+                        Ext.Array.each(menuItem, function (mi) {
                             var menuItemText = mi.getElementsByClassName('item-text');
                             var menuItemIcon = mi.getElementsByClassName('item-icon');
 
-                            Ext.Array.each(menuItemText, function(item) {
-                                item.addEventListener('click', function(e) {
+                            Ext.Array.each(menuItemText, function (item) {
+                                item.addEventListener('click', function (e) {
                                     var target = e.target,
-                                    dataset = target.dataset;
+                                        dataset = target.dataset;
                                     mainView = Ext.getCmp('mainView'),
-                                    controller = mainView.getController();
-        
+                                        controller = mainView.getController();
+
                                     controller.setActiveTab(dataset);
                                     menu.hide();
                                 });
                             });
-                            Ext.Array.each(menuItemIcon, function(item) {
-                                item.addEventListener('click', function(e) {
+                            Ext.Array.each(menuItemIcon, function (item) {
+                                item.addEventListener('click', function (e) {
                                     var target = e.target,
-                                    dataset = target.dataset;
+                                        dataset = target.dataset;
                                     mainView = Ext.getCmp('mainView'),
-                                    controller = mainView.getController();
-        
+                                        controller = mainView.getController();
+
                                     controller.setActiveTab(dataset);
                                     menu.hide();
                                 });
@@ -414,17 +431,17 @@ Ext.define('saas.view.main.Navigation', {
         menu.showAt(pos);
     },
 
-    hideNavMenu: function(view, record, item, index, e, eOpts) {
+    hideNavMenu: function (view, record, item, index, e, eOpts) {
         var recData = record.data,
-        cx = e.browserEvent.clientX,
-        cy = e.browserEvent.clientY,
-        itemBox = item.getBoundingClientRect(),
-        id = recData.id,
-        menuId = 'navMenu-' + id,
-        menu = Ext.getCmp(menuId);
+            cx = e.browserEvent.clientX,
+            cy = e.browserEvent.clientY,
+            itemBox = item.getBoundingClientRect(),
+            id = recData.id,
+            menuId = 'navMenu-' + id,
+            menu = Ext.getCmp(menuId);
 
-        if(cx <= itemBox.left || cy <= itemBox.top || cy >= (itemBox.top + itemBox.height)) {
-            if(menu) {
+        if (cx <= itemBox.left || cy <= itemBox.top || cy >= (itemBox.top + itemBox.height)) {
+            if (menu) {
                 menu.hide();
             }
         }

+ 9 - 3
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -20,7 +20,6 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _auditUrl:'http://192.168.0.181:8560/api/purchase/purchase/audit',
      _deleteUrl:'http://192.168.0.181:8560/api/purchase/purchase/delete/',
      _deleteDetailUrl:'http://192.168.0.181:8560/api/purchase/purchase/deleteItem/',
-    // _turnInUrl:'http://192.168.0.181:8560/api/purchase/purchase/turnProdin/',
      _turnInUrl:'http://192.168.253.228:8800/purchase/turnProdin/',
      initId:0,
  
@@ -112,6 +111,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
+        storeModel:'saas.model.purchase.purchasedetail',
         columns : [
             {
                 text : "序号", 
@@ -152,12 +152,18 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
             {
                 text : "名称", 
                 dataIndex : "pr_detail",
-                ignore:true
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
+                }
             },
             {
                 text : "规格", 
                 dataIndex : "pr_spec",
-                ignore:true
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
+                }
             },
             {
                 text : "数量", 

+ 8 - 2
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -68,9 +68,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                         conditionCode:'pr_code',
                         dataUrl:'http://192.168.0.181:8570/api/document/product/getProductsByCondition',
                         dbfinds:[{
-                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_id',to:'pd_prodid'                          
+                        },{
+                            from:'pr_code',to:'pd_prodcode'                          
+                        },{
+                            from:'pr_detail',to:'pr_detail'
+                        },{
                             from:'pr_unit',to:'pd_unit'
-                        }],
+                        }
+                    ],
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{

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

@@ -121,6 +121,11 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"
+            },{
+                text : "物料id", 
+                dataIndex : "pd_prodid", 
+                xtype : "numbercolumn",
+                hidden:true
             },
             {
                 text : "物料编号", 

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

@@ -84,6 +84,13 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         readOnly: true,
         columnWidth : 0.25
     }, {
+        xtype : "textfield", 
+        name : "pi_puid", 
+        bind : "{pi_puid}", 
+        fieldLabel : "采购单id", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
         xtype : "textfield", 
         name : "pi_pucode", 
         bind : "{pi_pucode}", 

+ 5 - 5
frontend/saas-web/app/view/test/order/FormPanel.js

@@ -15,11 +15,11 @@ Ext.define('saas.view.test.order.FormPanel', {
     _statusCodeField: 'pu_statuscode',
     _detnoColumn:  'pd_detno',
     _relationColumn: 'pd_puid',
-    _readUrl:'http://192.168.253.58:8800/purchase/read/',
-    _saveUrl:'http://192.168.253.58:8800/purchase/save',
-    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+    _readUrl:'http://192.168.253.228:8800/purchase/read/',
+    _saveUrl:'http://192.168.253.228:8800/purchase/save',
+    _auditUrl:'http://192.168.253.228:8800/purchase/audit',
+    _deleteUrl:'http://192.168.253.228:8800/purchase/delete/',
+    _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
     initId:0,
 
     toolBtns: [{

+ 1 - 1
frontend/saas-web/index.html

@@ -1,5 +1,5 @@
 <!DOCTYPE HTML>
-<html manifest="">
+<html lang="zh-cn" manifest="">
 <head>
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta charset="UTF-8">