Browse Source

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

heqinwei 7 years ago
parent
commit
dba5b32f32
50 changed files with 961 additions and 365 deletions
  1. 66 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java
  2. 62 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDetailDTO.java
  3. 156 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java
  4. 7 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  5. 8 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  6. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java
  7. 58 3
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  8. 242 0
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  9. 2 2
      base-servers/account/account-server/src/main/resources/mapper/AccountRoleMapper.xml
  10. 1 0
      frontend/saas-web/app/view/auth/CompanyPicker.scss
  11. 2 1
      frontend/saas-web/app/view/auth/LoginController.js
  12. 1 1
      frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js
  13. 1 1
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  14. 1 1
      frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js
  15. 1 1
      frontend/saas-web/app/view/core/dbfind/types/ProductMultiDbfindTrigger.js
  16. 1 1
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  17. 0 77
      frontend/saas-web/app/view/document/employee/BasePanel.js
  18. 0 10
      frontend/saas-web/app/view/document/employee/BasePanelController.js
  19. 0 4
      frontend/saas-web/app/view/document/employee/BasePanelModel.js
  20. 0 60
      frontend/saas-web/app/view/document/employee/FormController.js
  21. 0 8
      frontend/saas-web/app/view/document/employee/FormModel.js
  22. 0 74
      frontend/saas-web/app/view/document/employee/FormPanel.js
  23. 52 1
      frontend/saas-web/app/view/document/kind/ChildForm.js
  24. 60 0
      frontend/saas-web/app/view/document/kind/Kind.js
  25. 16 17
      frontend/saas-web/app/view/document/kind/KindController.js
  26. 30 0
      frontend/saas-web/app/view/document/kind/KindModel.js
  27. 27 0
      frontend/saas-web/app/view/document/other/Employee.js
  28. 4 4
      frontend/saas-web/app/view/home/InfoCard.js
  29. 8 4
      frontend/saas-web/app/view/main/Main.js
  30. 35 15
      frontend/saas-web/app/view/main/Main.scss
  31. 1 1
      frontend/saas-web/app/view/main/MainController.js
  32. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  33. 1 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  34. 1 1
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  35. 1 1
      frontend/saas-web/app/view/money/othreceipts/QueryPanel.js
  36. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  37. 3 3
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  38. 5 5
      frontend/saas-web/app/view/money/recBalance/QueryPanel.js
  39. 6 6
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  40. 5 5
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  41. 11 2
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  42. 26 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  43. 2 2
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  44. 1 1
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  45. 2 2
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  46. 1 1
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  47. 2 2
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  48. 45 40
      frontend/saas-web/app/view/sys/feedback/FormPanel.js
  49. 1 0
      frontend/saas-web/app/view/viewport/ViewportController.js
  50. 2 3
      frontend/saas-web/resources/json/navigation.json

+ 66 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java

@@ -0,0 +1,66 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class PurchaseDTO extends CommonBaseEntity implements Serializable {
+
+    private String pu_code;
+
+    private Date pu_date;
+
+    private Integer pu_vendid;
+
+    private String pu_vendcode;
+
+    private String pu_vendname;
+
+    private Integer pu_buyerid;
+
+    private String pu_buyercode;
+
+    private String pu_buyername;
+
+    private Date pu_delivery;
+
+    private Double pu_taxtotal;
+
+    private Double pu_total;
+
+    private String pu_remark;
+
+    private String pu_totalupper;
+
+    private String pu_printstatus;
+
+    private String pu_printstatuscode;
+
+    private String pu_acceptstatuscode;
+
+    private String pu_acceptstatus;
+
+    private String pu_statuscode;
+
+    private String pu_status;
+
+    private String pu_text1;
+
+    private String pu_text2;
+
+    private String pu_text3;
+
+    private String pu_text4;
+
+    private String pu_text5;
+
+    private String pu_shipaddresscode;
+
+    private String pu_auditman;
+
+    private Date pu_auditdate;
+
+}

+ 62 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDetailDTO.java

@@ -0,0 +1,62 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class PurchaseDetailDTO extends CommonBaseEntity implements Serializable {
+
+    private  Long pd_puid;
+
+    private String pd_code;
+
+    private Integer pd_detno;
+
+    private Long pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_qty;
+
+    private Double pd_price;
+
+    private Double pd_taxprice;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_taxtotal;
+
+    private Double pd_acceptqty;
+
+    private Date pd_delivery;
+
+    private String pd_salecode;
+
+    private Integer pd_saledetno;
+
+    private Integer pd_sdid;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Double pd_yqty;
+
+    private  String pd_remark;
+
+    private ProductDTO productDTO;
+}

+ 156 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java

@@ -0,0 +1,156 @@
+package com.usoftchina.saas.sale.dto;
+
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-10-10 16:42
+ **/
+@Data
+public class PurchaseListDTO extends CommonBaseEntity implements Serializable {
+
+    //主表信息
+    private  Integer pu_id;
+
+    private String pu_code;
+
+    private Date pu_date;
+
+    private Integer pu_vendid;
+
+    private String pu_vendcode;
+
+    private String pu_vendname;
+
+    private Integer pu_buyerid;
+
+    private String pu_buyercode;
+
+    private String pu_buyername;
+
+    private Date pu_delivery;
+
+    private Double pu_taxtotal;
+
+    private Double pu_total;
+
+    private String pu_remark;
+
+    private String pu_totalupper;
+
+    private String pu_printstatus;
+
+    private String pu_printstatuscode;
+
+    private String pu_acceptstatuscode;
+
+    private String pu_acceptstatus;
+
+    private String pu_statuscode;
+
+    private String pu_status;
+
+    private String pu_text1;
+
+    private String pu_text2;
+
+    private String pu_text3;
+
+    private String pu_text4;
+
+    private String pu_text5;
+
+    private String pu_shipaddresscode;
+
+    private Date pu_auditdate;
+
+    private String pu_auditman;
+
+    //从表字段
+    private Long pd_id;
+
+    private  Long pd_puid;
+
+    private String pd_code;
+
+    private Integer pd_detno;
+
+    private Integer pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_qty;
+
+    private Double pd_price;
+
+    private Double pd_taxprice;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_taxtotal;
+
+    private Double pd_acceptqty;
+
+    private Date pd_delivery;
+
+    private String pd_salecode;
+
+    private Integer pd_saledetno;
+
+    private Integer pd_sdid;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Double pd_yqty;
+
+    private String pd_remark;
+
+    private String pd_ordercode;
+
+    //private ProductDTO productDTO;
+    private Long pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private String pr_kind;
+    private String pr_orispeccode;
+    private long pr_whid;
+    private String pr_whcode;
+    private String pr_whname;
+    private long pr_zxbzs;
+    private long pr_leadtime;
+    private String pr_brand;
+    private String pr_standardprice;
+    private String pr_purcprice;
+    private String pr_saleprice;
+    private long pr_vendid;
+    private String pr_vendname;
+    private String pr_vendcode;
+    private Date pr_docdate;
+    private long pr_recordmanid;
+    private String pr_recordman;
+    private String pr_status;
+    private String pr_statuscode;
+    private String pr_text1;
+    private String pr_text2;
+    private String pr_text3;
+    private String pr_text4;
+}

+ 7 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -186,7 +186,13 @@ public class SaleController {
        return Result.success();
     }
 
-    @GetMapping("/test")
+    @PostMapping("/saleTurnPurchase/{id}")
+    public Result saleTurnPurchase(@PathVariable("id") Long id){
+        DocBaseDTO baseDTO = saleService.saleTurnPurchase(id);
+        return Result.success(baseDTO);
+    }
+
+  @GetMapping("/test")
     public String test() {
         return "配置构建success-1";
     }

+ 8 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.sale.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.sale.dto.PurchaseDTO;
+import com.usoftchina.saas.sale.dto.PurchaseDetailDTO;
 import com.usoftchina.saas.sale.po.Sale;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
@@ -42,4 +44,10 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
     Integer checkSendStatus(Long id);
 
     void updateCreator(@Param("userId") Long userId, @Param("userName") String userName, @Param("id") Long id);
+
+    void turnPurchase(PurchaseDTO purchase);
+
+    void turnPurchaseDetail(List<PurchaseDetailDTO> list);
+
+    Integer selectPurchaseId(@Param("code") String code,@Param("companyid") Long companyid);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java

@@ -44,4 +44,6 @@ public interface SaleService {
     void batchClose(BatchDealBaseDTO baseDTOs);
 
     void batchOpen(BatchDealBaseDTO baseDTOs);
+
+    DocBaseDTO saleTurnPurchase(Long id);
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
@@ -14,12 +15,11 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.sale.dto.SaleDTO;
-import com.usoftchina.saas.sale.dto.SaleDetailDTO;
-import com.usoftchina.saas.sale.dto.SaleFormDTO;
+import com.usoftchina.saas.sale.dto.*;
 import com.usoftchina.saas.sale.mapper.*;
 import com.usoftchina.saas.sale.po.Sale;
 import com.usoftchina.saas.sale.po.SaleDetail;
@@ -524,6 +524,61 @@ public class SaleServiceImpl implements SaleService{
 
     }
 
+    @Override
+    public DocBaseDTO saleTurnPurchase(Long id) {
+        Sale sale = saleMapper.selectByPrimaryKey(id);
+        List<SaleList> dateilList = saleListMapper.selectSaleListByCondition("sa_id="+id,BaseContextHolder.getCompanyId());
+
+        PurchaseDTO purchase = new PurchaseDTO();
+        List<PurchaseDetailDTO> listPurchaseDetail = new ArrayList<PurchaseDetailDTO>();
+
+        //销售主表转采购主表
+        Result<String> result = maxnumberService.getMaxnumber(BillCodeSeq.PURCHASE.getCaller(),false);
+        purchase.setPu_code(result.getData());
+        purchase.setPu_status(Status.UNAUDITED.getDisplay());
+        purchase.setPu_statuscode(Status.UNAUDITED.toString());
+        purchase.setCompanyId(BaseContextHolder.getCompanyId());
+        purchase.setCreatorId(BaseContextHolder.getUserId());
+        purchase.setCreateTime(new Date());
+        purchase.setCreatorName(BaseContextHolder.getUserName());
+        saleMapper.turnPurchase(purchase);
+
+        Long purchaseId = purchase.getId();
+        for (SaleList detail : dateilList){
+            PurchaseDetailDTO purchaseDetailDTO = new PurchaseDetailDTO();
+            Double taxPrice = detail.getPr_purcprice()==null?new Double(0):Double.valueOf(detail.getPr_purcprice());
+            Double taxrate = detail.getSd_taxrate()==null?new Double(0):detail.getSd_taxrate();
+            Double qty = detail.getSd_qty()==null?new Double(0):detail.getSd_qty();
+            purchaseDetailDTO.setPd_prodid(Long.valueOf(String.valueOf(detail.getSd_prodid())));
+            purchaseDetailDTO.setPd_prodcode(detail.getSd_prodcode());
+            purchaseDetailDTO.setPd_detno(detail.getSd_detno());
+            purchaseDetailDTO.setPd_qty(detail.getSd_qty());
+            purchaseDetailDTO.setPd_price(taxPrice/(1+taxrate));
+            purchaseDetailDTO.setPd_salecode(sale.getSa_code());
+            purchaseDetailDTO.setPd_saledetno(detail.getSd_detno());
+            purchaseDetailDTO.setPd_taxrate(taxrate);
+            purchaseDetailDTO.setPd_taxprice(taxPrice);
+            purchaseDetailDTO.setPd_taxtotal(taxPrice*qty);
+            purchaseDetailDTO.setCompanyId(BaseContextHolder.getCompanyId());
+            purchaseDetailDTO.setCreatorId(BaseContextHolder.getUserId());
+            purchaseDetailDTO.setCreateTime(new Date());
+            purchaseDetailDTO.setCreatorName(BaseContextHolder.getUserName());
+            purchaseDetailDTO.setPd_puid(purchaseId);
+            purchaseDetailDTO.setPd_code(result.getData());
+            listPurchaseDetail.add(purchaseDetailDTO);
+        }
+
+        saleMapper.turnPurchaseDetail(listPurchaseDetail);
+
+
+
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setCode(result.getData());
+        baseDTO.setId(Long.valueOf(String.valueOf(purchaseId)));
+        baseDTO.setName(BillCodeSeq.PURCHASE.getName());
+        return baseDTO;
+    }
+
     //更新最新销售总额
     private void updateTotal(Long id) {
         if (null == id) {

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

@@ -421,4 +421,246 @@
   <update id="updateCreator">
     update sale set creatorId = #{userId} , creatorName=#{userName} where sa_id=#{id}
   </update>
+  
+  
+  
+  <!-- 销售订单转采购单-->
+  <insert id="turnPurchase" parameterType="com.usoftchina.saas.sale.dto.PurchaseDTO" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into purchase
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="pu_code != null" >
+        pu_code,
+      </if>
+      <if test="pu_date != null" >
+        pu_date,
+      </if>
+      <if test="pu_vendid != null" >
+        pu_vendid,
+      </if>
+      <if test="pu_vendcode != null" >
+        PU_VENDCODE,
+      </if>
+      <if test="pu_vendname != null" >
+        PU_VENDNAME,
+      </if>
+      <if test="pu_buyerid != null" >
+        PU_BUYERID,
+      </if>
+      <if test="pu_buyercode != null" >
+        PU_BUYERCODE,
+      </if>
+      <if test="pu_buyername != null" >
+        PU_BUYERNAME,
+      </if>
+      <if test="pu_delivery != null" >
+        PU_DELIVERY,
+      </if>
+      <if test="pu_taxtotal != null" >
+        PU_TAXTOTAL,
+      </if>
+      <if test="pu_total != null" >
+        PU_TOTAL,
+      </if>
+      <if test="pu_remark != null" >
+        PU_REMARK,
+      </if>
+      <if test="pu_totalupper != null" >
+        PU_TOTALUPPER,
+      </if>
+      <if test="pu_printstatus != null" >
+        PU_PRINTSTATUS,
+      </if>
+      <if test="pu_printstatuscode != null" >
+        PU_PRINTSTATUSCODE,
+      </if>
+      <if test="pu_acceptstatuscode != null" >
+        PU_ACCEPTSTATUSCODE,
+      </if>
+      <if test="pu_acceptstatus != null" >
+        PU_ACCEPTSTATUS,
+      </if>
+      <if test="pu_statuscode != null" >
+        PU_STATUSCODE,
+      </if>
+      <if test="pu_status != null" >
+        PU_STATUS,
+      </if>
+      <if test="companyId != null" >
+        companyid,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updaterName != null" >
+        updaterName,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="pu_text1 != null" >
+        pu_text1,
+      </if>
+      <if test="pu_text2 != null" >
+        pu_text2,
+      </if>
+      <if test="pu_text3 != null" >
+        pu_text3,
+      </if>
+      <if test="pu_text4 != null" >
+        pu_text4,
+      </if>
+      <if test="pu_text5 != null" >
+        pu_text5,
+      </if>
+      <if test="pu_shipaddresscode != null" >
+        PU_SHIPADDRESSCODE,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="pu_code != null" >
+        #{pu_code,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_date != null" >
+        #{pu_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_vendid != null" >
+        #{pu_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_vendcode != null" >
+        #{pu_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_vendname != null" >
+        #{pu_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_buyerid != null" >
+        #{pu_buyerid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_buyercode != null" >
+        #{pu_buyercode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_buyername != null" >
+        #{pu_buyername,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_delivery != null" >
+        #{pu_delivery,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_taxtotal != null" >
+        #{pu_taxtotal,jdbcType=DOUBLE},
+      </if>
+      <if test="pu_total != null" >
+        #{pu_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pu_remark != null" >
+        #{pu_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_totalupper != null" >
+        #{pu_totalupper,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_printstatus != null" >
+        #{pu_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_printstatuscode != null" >
+        #{pu_printstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_acceptstatuscode != null" >
+        #{pu_acceptstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_acceptstatus != null" >
+        #{pu_acceptstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_statuscode != null" >
+        #{pu_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_status != null" >
+        #{pu_status,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterName != null" >
+        #{updaterName,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pu_text1 != null" >
+        #{pu_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text2 != null" >
+        #{pu_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text3 != null" >
+        #{pu_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text4 != null" >
+        #{pu_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_text5 != null" >
+        #{pu_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_shipaddresscode != null" >
+        #{pu_shipaddresscode,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+  <insert id="turnPurchaseDetail" parameterType="java.util.List" >
+    insert into purchasedetail ( PD_PUID, PD_CODE,
+    PD_DETNO, PD_PRODID, PD_PRODCODE,
+    PD_UNIT, PD_QTY, PD_PRICE,PD_TAXPRICE,
+    PD_TOTAL,PD_TAXRATE, PD_TAXTOTAL, PD_ACCEPTQTY,
+    PD_DELIVERY, PD_SALECODE, PD_SALEDETNO,
+    PD_SDID, companyId, updaterId,
+    updateTime, pd_text1, pd_text2,
+    pd_text3, pd_text4, pd_text5,
+    pd_yqty,pd_remark)
+    values
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      (
+      #{item.pd_puid,jdbcType=INTEGER}, #{item.pd_code,jdbcType=VARCHAR},
+      #{item.pd_detno,jdbcType=INTEGER}, #{item.pd_prodid,jdbcType=INTEGER}, #{item.pd_prodcode,jdbcType=VARCHAR},
+      #{item.pd_unit,jdbcType=VARCHAR}, #{item.pd_qty,jdbcType=DOUBLE}, #{item.pd_price,jdbcType=DOUBLE},#{item.pd_taxprice,jdbcType=DOUBLE},
+      #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE}, #{item.pd_taxtotal,jdbcType=DOUBLE}, #{item.pd_acceptqty,jdbcType=DOUBLE},
+      #{item.pd_delivery,jdbcType=DOUBLE}, #{item.pd_salecode,jdbcType=VARCHAR}, #{item.pd_saledetno,jdbcType=INTEGER},
+      #{item.pd_sdid,jdbcType=INTEGER}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.pd_text1,jdbcType=VARCHAR}, #{item.pd_text2,jdbcType=VARCHAR},
+      #{item.pd_text3,jdbcType=VARCHAR}, #{item.pd_text4,jdbcType=VARCHAR}, #{item.pd_text5,jdbcType=VARCHAR},
+      #{item.pd_yqty,jdbcType=DOUBLE}, #{item.pd_remark,jdbcType=VARCHAR}
+      )
+    </foreach>
+  </insert>
+  <select id="selectPurchaseId" resultType="int">
+    select pu_id from purchase where
+    <if test="code !=null">
+      pu_code=#{code}
+    </if> and
+    <if test="companyid !=null">
+      companyid=#{companyid}
+    </if>
+
+  </select>
 </mapper>

+ 2 - 2
base-servers/account/account-server/src/main/resources/mapper/AccountRoleMapper.xml

@@ -20,8 +20,8 @@
         SELECT a.id id,a.username,a.realname,a.email,a.mobile,GROUP_CONCAT(c.name) roleNames,GROUP_CONCAT(c.id) roleIds
         FROM ac_account a
         left join ac_account_company d on a.id = d.account_id
-        left join ac_account_role b on a.id=b.account_id
-        left join ac_role c  on b.role_id = c.id
+        left join ac_account_role b on a.id=b.account_id and d.company_id = b.company_id
+        left join ac_role c  on b.role_id = c.id and b.company_id = c.company_id
         <where>
             <if test="condition!=null">
                 ${condition}

+ 1 - 0
frontend/saas-web/app/view/auth/CompanyPicker.scss

@@ -18,6 +18,7 @@
         overflow: hidden;
         border-top: 1px solid transparent;
         cursor: pointer;
+        border-radius: 4px;
 
         img {
             margin-bottom: 10px;

+ 2 - 1
frontend/saas-web/app/view/auth/LoginController.js

@@ -65,7 +65,8 @@ Ext.define('saas.view.auth.LoginController', {
             })
             .then(function() {
                 view.isMasked() && view.unmask();
+                view.close();
                 view.ownerCt.destroy();
-            });        
+            });
     }
 });

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js

@@ -26,7 +26,7 @@ Ext.define('saas.view.core.dbfind.types.BankInfoDbfindTrigger', {
         text: "账户ID",
         flex: 0,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: ""
     }, {
         text: "资金账户",

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         conditionCode: 'id',
         text: "客户ID",
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "",
     }, {
         conditionCode: 'cu_code',

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.EmployeeDbfindTrigger', {
         text: "人员ID",
         hidden: true,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "numbercolumn"
     },{
         text: "人员编号",

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/ProductMultiDbfindTrigger.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.core.dbfind.types.ProductMultiDbfindTrigger', {
         dataIndex: "pr_purcprice",
         align: 'end',
         xtype: 'numbercolumn',
-        width: 0,
+        hidden:true,
     }, {
         text: "仓库id",
         dataIndex: "pr_whid",

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js

@@ -31,7 +31,7 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
         text: "仓库ID",
         flex: 0,
         dataIndex: "id",
-        width: 0,
+        hidden:true,
         xtype: "",
     }, {
         text: "仓库编号",

+ 0 - 77
frontend/saas-web/app/view/document/employee/BasePanel.js

@@ -1,77 +0,0 @@
-Ext.define('saas.view.document.employee.BasePanel', {
-    extend: 'saas.view.core.base.BasePanel',
-    xtype: 'document-employee-basepanel',
-
-    controller: 'document-employee-basepanel',
-    viewModel: 'document-employee-basepanel',
-
-    searchField:[{ 
-        xtype : "textfield", 
-        name : "em_code", 
-        emptyText : "账号", 
-        width:120
-    },{
-        xtype : "textfield", 
-        name : "em_name", 
-        emptyText : "姓名", 
-        width:120
-    },{
-        xtype : "textfield", 
-        name : "em_class", 
-        emptyText : "类型",    
-        width:100
-    },{
-        xtype : "textfield", 
-        name : "name", 
-        emptyText : "角色",    
-        width:100
-    }],
-
-    //字段属性
-    _formXtype:'document-employee-formpanel',
-    _title:'人员资料',
-    _deleteUrl:'/api/document/employee/delete/',
-
-    gridConfig: {
-        idField: 'id',
-        codeField: 'pr_code',
-        statusCodeField:'pr_statuscode',
-        dataUrl: '/api/document/employee/list',
-        columns : [{
-            text : "id", 
-            width : 0, 
-            dataIndex : "id", 
-            xtype : "numbercolumn", 
-        },{
-            text : "账号", 
-            width : 200.0, 
-            dataIndex : "em_code", 
-        }, 
-        {
-            text : "姓名", 
-            dataIndex : "em_name", 
-            width : 180.0, 
-        },
-        {
-            text : "密码", 
-            dataIndex : "em_password", 
-            width : 180.0, 
-        }, 
-        {
-            text : "类型", 
-            dataIndex : "em_class", 
-            width : 120.0, 
-            hidden : true,
-        }, 
-        {
-            text : "电话", 
-            dataIndex : "em_mobile", 
-            width : 120.0,
-        }]
-    },
-
-    refresh:function(){
-        this.items.items[0].store.load()
-    }
-
-});

+ 0 - 10
frontend/saas-web/app/view/document/employee/BasePanelController.js

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

+ 0 - 4
frontend/saas-web/app/view/document/employee/BasePanelModel.js

@@ -1,4 +0,0 @@
-Ext.define('saas.view.document.employee.BasePanelModel', {
-    extend: 'saas.view.core.base.BasePanelModel',
-    alias: 'viewmodel.document-employee-basepanel'
-});

+ 0 - 60
frontend/saas-web/app/view/document/employee/FormController.js

@@ -1,60 +0,0 @@
-Ext.define('saas.view.document.employee.FormController', {
-    extend: 'saas.view.core.form.FormPanelController',
-    alias: 'controller.document-employee-formpanel',
-
-    auditBtnClick: function() {
-        var me = this,
-        form = me.getView(),
-        statusCodeField = form._statusCodeField,
-        viewModel = me.getViewModel(),
-        status = viewModel.data[statusCodeField];
-        status == 'OPEN' ? me.unAudit() : me.audit();
-    },
-
-    audit: function(){
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel();
-        
-        saas.util.BaseUtil.request({
-            url: form._openUrl+'/'+viewModel.data.id,
-            params: '',
-            method: 'POST',
-        })
-        .then(function(localJson) {
-            if(localJson.success){
-                form.initId = localJson.data.id;
-                saas.util.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
-                saas.util.BaseUtil.showToast('启用成功');
-            }
-        })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showToast('启用失败: ' + res.message);
-        });
-    },
-    unAudit: function() {
-        var me = this,
-        form = this.getView(),
-        viewModel = me.getViewModel();
-        
-        saas.util.BaseUtil.request({
-            url: form._closeUrl+'/'+viewModel.data.id,
-            params: '',
-            method: 'POST',
-        })
-        .then(function(localJson) {
-            if(localJson.success){
-                form.initId = localJson.data.id;
-                saas.util.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
-                saas.util.BaseUtil.showToast('禁用成功');
-            }
-        })
-        .catch(function(res) {
-            console.error(res);
-            saas.util.BaseUtil.showToast('禁用失败: ' + res.message);
-        });
-    }
-});

+ 0 - 8
frontend/saas-web/app/view/document/employee/FormModel.js

@@ -1,8 +0,0 @@
-Ext.define('saas.view.document.employee.FormModel', {
-    extend: 'saas.view.core.form.FormPanelModel',
-    alias: 'viewmodel.document-employee-formpanel',
-
-    data: {
-        showAuditBtn:false
-    }
-});

+ 0 - 74
frontend/saas-web/app/view/document/employee/FormPanel.js

@@ -1,74 +0,0 @@
-Ext.define('saas.view.document.employee.FormPanel', {
-    extend: 'saas.view.core.form.FormPanel',
-    xtype: 'document-employee-formpanel',
-    controller: 'document-employee-formpanel',
-    viewModel: 'document-employee-formpanel',
-    caller:'Employee',
-    //字段属性
-    _title:'物料资料',
-    _idField: 'id',
-    _codeField: 'em_code',
-    _readUrl:'/api/document/employee/read/',
-    _saveUrl:'/api/document/employee/save',
-    _deleteUrl:'/api/document/employee/delete/',
-    _deleteMsg:'删除的人员资料将不能恢复,请确认是否删除?',
-    initId:0,
-    codeInHeader: false,
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_code',
-        fieldLabel: '账号',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_name',
-        fieldLabel: '姓名',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_password',
-        fieldLabel: '密码',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'combobox',
-        name: 'em_class',
-        columnWidth: 0.25,
-        fieldLabel: '类型',
-        queryMode: 'local',
-        displayField: 'name',
-        valueField: 'value',
-        allowBlank:false,
-        editable:false,
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['name', 'value'],
-            data: [
-                ["正式", "正式"],
-                ["离职", "离职"],
-            ]
-        })
-    },{
-        xtype: 'textfield',
-        name: 'em_mobile',
-        fieldLabel: '电话',
-        allowBlank: false,
-        columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'em_email',
-        fieldLabel: '邮箱',
-        // allowBlank: false,
-        columnWidth: 0.25
-    }],
-    auditTexts: {
-
-    }
-});

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

@@ -274,7 +274,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 name: 'wh_type',
                 allowBlank:false,
                 displayField : "display", 
-                editable:true,
+                editable:false,
                 hideTrigger : false, 
                 maxLength : 100.0, 
                 minValue : null, 
@@ -302,6 +302,57 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 value:'OPEN'
             }]
         },
+        employee:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员编号',
+                name: 'em_code',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '人员名称',
+                name: 'em_name',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '联系电话',
+                name: 'em_mobile',
+                allowBlank:false,
+                maxLength: 20
+            },{
+                xtype:'textfield',
+                fieldLabel: '邮箱',
+                name: 'em_email', 
+                allowBlank:false,  
+                maxLength: 20
+            },{
+                value:'正式',
+                xtype:'combo',
+                fieldLabel: '人员状态',
+                name: 'em_class',
+                allowBlank:false,
+                displayField : "display", 
+                editable:false,
+                hideTrigger : false, 
+                maxLength : 100.0, 
+                minValue : null, 
+                positiveNum : false, 
+                queryMode : "local", 
+                valueField : "value", 
+                store:{
+                    fields: ['display', 'value'],
+                    data : [
+                        {"display":"正式", "value":'正式'},
+                        {"display":"离职", "value":'离职'}
+                    ]
+                }
+            },]
+        },
         maxnumbers:{
             items:[{
                 xtype:'hidden',

+ 60 - 0
frontend/saas-web/app/view/document/kind/Kind.js

@@ -258,6 +258,66 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             reqUrl:'/api/account/account/bind/roles',
         },
+        employee:{
+            columns: [{
+                text: '人员编号',
+                dataIndex: 'em_code',
+                width: 200
+            },{
+                text: '人员名称',
+                dataIndex: 'em_name',
+                width: 200
+            },{
+                text: '联系电话',
+                dataIndex: 'em_mobile',
+                width: 200
+            },{  
+                text: '邮箱',
+                dataIndex: 'em_email',
+                width: 200
+            },{
+                text: '人员状态',
+                dataIndex: 'em_class',
+                width:90,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('em_class')=='正式'){
+                            return 'x-grid-checkcolumn-checked-btn';
+                        }else{
+                            return 'x-grid-checkcolumn-btn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('em_class')=='正式'?true:false;
+                        //  禁用/启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        saas.util.BaseUtil.request({
+                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                            params: '',
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                saas.util.BaseUtil.showToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            saas.util.BaseUtil.showToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
+            }],
+            keyField:'id',
+            reqUrl: '/api/document/employee/save',
+            delUrl: '/api/document/employee/delete'
+        },
         warehouse:{
             columns: [{
                 text: '编号',

+ 16 - 17
frontend/saas-web/app/view/document/kind/KindController.js

@@ -32,10 +32,10 @@ Ext.define('saas.view.document.kind.KindController', {
         if(store) store.reload();
         vm.set('title', button.typeText);
     },
-    onAdd:function(){
-        var me=this,
-            dataKind=me.getViewModel().getData()['dataKind'].value;
-        me.createDialog(dataKind);
+    onAdd:function(b){
+        var dk = b.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value;
+        this.createDialog(dataKind,null,dk);
     },
     onRefresh:function(){
         var me = this;
@@ -64,20 +64,19 @@ Ext.define('saas.view.document.kind.KindController', {
         return columns;
     },
     onEdit:function(grid,row,col){
-        var me=this,
-            dataKind=me.getViewModel().getData()['dataKind'].value;
-            rec = grid.getStore().getAt(row);
-        this.createDialog(dataKind,rec);
+        var dk = grid.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value,
+        rec = grid.getStore().getAt(row);
+        this.createDialog(dataKind,rec,dk);
     },
     onDelete:function(grid,row,col){
-        var me=this,
-            view=me.getView(),
-            dataKind=me.getViewModel().getData()['dataKind'].value;
+        var dk = grid.ownerCt.ownerCt;
+        var dataKind=dk.getViewModel().getData()['dataKind'].value,
         rec = grid.getStore().getAt(row);
-        var keyV=rec.get(view.etc[dataKind].keyField);
+        var keyV=rec.get(dk.etc[dataKind].keyField);
         //删除接口
         saas.util.BaseUtil.request({
-            url: view.etc[dataKind].delUrl+'/'+keyV,
+            url: dk.etc[dataKind].delUrl+'/'+keyV,
             method: 'POST'
         })
         .then(function(localJson) {
@@ -91,8 +90,8 @@ Ext.define('saas.view.document.kind.KindController', {
             saas.util.BaseUtil.showToast('删除失败: ' + res.message);
         });
     },
-    createDialog: function(dataKind,record) {
-        var view = this.getView();var me=this;
+    createDialog: function(dataKind,record,dk) {
+        var view = dk;
         this.isEdit = !!record;
         this.dialog = view.add({
             autoScroll:true,
@@ -101,8 +100,8 @@ Ext.define('saas.view.document.kind.KindController', {
                 title: record ? '修改{title}' : '新增{title}'
             },
             dataKind:dataKind,
-            belong:this.getView().etc[dataKind],
-            _parent:this.getView(),
+            belong:view.etc[dataKind],
+            _parent:view,
             record:record,
             session: true
         });

+ 30 - 0
frontend/saas-web/app/view/document/kind/KindModel.js

@@ -263,6 +263,36 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             }
         },
+        employee:{
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'em_code',  type: 'string'},
+                {name: 'em_mobile',  type: 'string'},
+                {name: 'em_email',  type: 'string'},
+                {name: 'em_clasee',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/employee/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data.list'
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        },
         productunit: {    
             fields:[
                 {name: 'id', type: 'int'},

+ 27 - 0
frontend/saas-web/app/view/document/other/Employee.js

@@ -0,0 +1,27 @@
+Ext.define('saas.view.document.other.Employee', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'other-employee',
+    autoScroll: true,
+    layout:'fit',
+    _openUrl:'/api/document/employee/open',
+    _closeUrl:'/api/document/employee/close',
+    defaultType:'employee',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
+    listeners:{
+        afterrender:function(p){
+            p.getViewModel().setData({title:'人员资料'});
+        }
+    }
+})

+ 4 - 4
frontend/saas-web/app/view/home/InfoCard.js

@@ -42,25 +42,25 @@ Ext.define('saas.view.home.InfoCard', {
                     title: '七天内待出货销售',
                     color: 'yellow',
                     viewType: 'sale-sale-querypanel',
-                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail where sd_said=sa_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now()) <7)'
+                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now()) between 0 and 7)'
                 },
                 unstorage: {
                     title: '七天内待入库采购',
                     color: 'purple',
                     viewType: 'purchase-purchase-querypanel',
-                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail where pd_puid=pu_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <7)'
+                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) between 0 and 7)'
                 },
                 unpay: {
                     title: '七天内待付款',
                     color: 'red',
                     viewType: 'purchase-purchasein-querypanel',
-                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) < 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unreceive: {
                     title: '七天内待收款',
                     color: 'pink',
                     viewType: 'sale-saleout-querypanel',
-                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) < 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=1 and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unauditcheck: {
                     title: '未审核验收',

+ 8 - 4
frontend/saas-web/app/view/main/Main.js

@@ -66,12 +66,14 @@ Ext.define('saas.view.main.Main', {
                 },
                 {
                     iconCls:'x-fa fa-question',
+                    cls:'sa-nav-button',
                     ui: 'header',
                     arrowVisible: false,
                     tooltip: '帮助',
                     width:50, 
+                    height:45,
                     menu: {
-                        cls:'x-main-menu',
+                        cls:'x-main-menu sa-nav-menu',
                         items: [{
                             text: '新手导航',
                             iconCls:'x-fa fa-comment-o sa-navicon',
@@ -94,6 +96,7 @@ Ext.define('saas.view.main.Main', {
                             text: '客服热线',
                             iconCls:'x-fa fa-comment-o sa-navicon',
                             menu:{
+                                cls:'sa-nav-menu',
                                 items:[{
                                     text:'<span onclick="javascript:window.open(\'http://www.usoftchina.com\');" style="text-decoration:underline;color:blue;">优软科技官网</span>'
                                 },{	
@@ -120,14 +123,15 @@ Ext.define('saas.view.main.Main', {
                 {
                     ui: 'header',
                     arrowVisible: false,
-                    id:"userImage",    
+                    id:"userImage", 
+                    cls:' sa-nav-button',   
                     width: 50,
                     height:50,    
                     bind: {
                         html:'<img class="x-img x-box-item x-toolbar-item x-img-header" style="height:35px;width:35px;margin-top: 6px;margin-left: 14px;" src="{avatarUrl}" alt="">'
                     }, 
                     menu: {
-                        cls:'x-main-menu2',
+                        cls:'x-main-menu2 sa-nav-menu', 
                         items: [ {  
                             text: '账户中心',
                             iconCls:'x-fa fa-user-o sa-navicon',
@@ -140,7 +144,7 @@ Ext.define('saas.view.main.Main', {
                             handler:'feedbackMsg'
                         }, {
                             text: '退出',
-                            iconCls:'x-fa fa-power-off',
+                            iconCls:'x-fa fa-power-off sa-navicon',
                             handler: 'onLogout'
                         }]
                     }

+ 35 - 15
frontend/saas-web/app/view/main/Main.scss

@@ -221,32 +221,35 @@ body > .x-mask {
     filter: grayscale(100%);
     filter: gray;
 }
- .x-main-menu{
+ .sa-nav-menu{
     background: #f8fbff;
     border: 1px solid #34baf6;
     margin-top: 10px;
  }
- .x-main-menu .x-menu-item-text-default {
+ .sa-nav-button{
+    box-shadow: none !important;
+ }
+ .sa-nav-menu.x-menu-item-text-default,
+ .sa-nav-menu  .sa-navicon {
     //font-family: PingFangSC-Regular;
     //font-size: 14px;
     color: #34BAF6;
     letter-spacing: 0;
     text-align: center;
  }
- .x-menu.x-main-menu .x-menu-bodyWrap{
+ .x-menu.sa-nav-menu .x-menu-bodyWrap{
     margin-left: -0.5px;
  }
-.x-main-menu .x-fa.sa-navicon{
+/* .x-main-menu .x-fa.sa-navicon{
     color: #34BAF6;
-} 
-.x-main-menu .x-menu-item-text-default.x-menu-item.x-menu-item-default-focus,
-.x-main-menu .x-menu-item-text-default.x-menu-item.x-menu-item-active{
+}  */
+.sa-nav-menu .x-menu-item.x-menu-item-default-focus  .x-menu-item-text-default ,
+.sa-nav-menu .x-menu-item.x-menu-item-active  .x-menu-item-text-default,
+.sa-nav-menu .x-menu-item.x-menu-item-default-focus  .sa-navicon ,
+.sa-nav-menu .x-menu-item.x-menu-item-active  .sa-navicon{
     color: white;
 }
-.x-main-menu .x-fa.sa-navicon.x-menu-item-default-focus,
-.x-main-menu .x-fa.sa-navicon.x-menu-item-active{
-    color: #34BAF6;
-} 
+
 .x-main-menu::before{
     content: ' ';
     display: block;
@@ -268,16 +271,14 @@ body > .x-mask {
     margin-left: 16px;
 }
 .x-main-menu2::before{
-    content: ' ';
+    /* content: ' ';
     display: block;
     border-style: solid;
     box-shadow: 0px 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(15, 136, 232, 0.6);
     box-shadow: aliceblue;
     border-width: 17px;
     border-color: #cccccc;
-    /* border-color: #cccccc #6e838e #9c9d9e #bdc3c5; */
     position: fixed;
-    /* left: 100%; */
     top: 26px;
     -moz-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
     -webkit-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
@@ -286,5 +287,24 @@ body > .x-mask {
     -khtml-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
     clip-path: polygon(0 100%, 50% 0, 100% 100%);
     margin-top: 25px;
-    margin-left: 47px;
+    margin-left: 47px; */
+
+    content: ' ';
+    display: block;
+    border-style: solid;
+    background-color: #f8fbff;
+    transform: rotate(45deg);
+    border-color: #34baf6;
+    position: fixed;
+    width: 15px;
+    height: 15px;
+    clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -moz-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -webkit-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -o-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -ms-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    -khtml-clip-path: polygon(0% 0, 100% 0%, 0 100%);
+    border-width: 1px 0px 0px 1px !important;
+    margin-top: -7.5px;
+    margin-left: 55px;
 }

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

@@ -121,7 +121,7 @@ Ext.define('saas.view.main.MainController', {
                 modal: true,
                 id:"feedbackWin",
                 height: '50%',
-                width: '50%',
+                width: '70%',
                 title: '意见反馈',
                 scrollable: true,
                 constrain: true,

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

@@ -44,7 +44,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间", 
                 dataIndex : "ftd_ym", 

+ 1 - 1
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -88,7 +88,7 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0
+            hidden:true
         }, {
             text: '单据编号',
             dataIndex: 'ft_code',

+ 1 - 1
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -70,7 +70,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间",
                 dataIndex : "ord_ym",

+ 1 - 1
frontend/saas-web/app/view/money/othreceipts/QueryPanel.js

@@ -89,7 +89,7 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

+ 1 - 1
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -70,7 +70,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "期间", 
                 dataIndex : "osd_ym", 

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

@@ -89,7 +89,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -143,7 +143,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
             text: '金额',
             xtype: 'numbercolumn',
             dataIndex: 'os_amount',
-            width: 0,
+            hidden:true,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -153,7 +153,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         }, {
             text: '备注',
             dataIndex: 'os_remark',
-            width: 0
+            hidden:true
         }],
         relativeColumn: []
     }

+ 5 - 5
frontend/saas-web/app/view/money/recBalance/QueryPanel.js

@@ -142,26 +142,26 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
         },{
             text: '源单编号',
             dataIndex: 'rbd_slcode',
-            width: 0
+            hidden:true
         },{
             text: '业务类别',
             dataIndex: 'rbd_slkind',
-            width: 0
+            hidden:true
         },{
             text: '单据日期',
             dataIndex: 'rbd_sldate',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         },{
             text: '单据金额',
             dataIndex: 'rbd_amount',
             xtype: 'numbercolumn',
-            width: 0
+            hidden:true
         },{
             text: '本次核销金额',
             dataIndex: 'rbd_nowbalance',
             xtype: 'numbercolumn',
-            width: 0
+            hidden:true
         },
         ]
     },

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

@@ -141,29 +141,29 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '录入人ID',
             dataIndex: 'creatorId',
-            width: 0
+            hidden:true
         }, {
             text: '录入人',
             dataIndex: 'creatorName',
-            width: 0
+            hidden:true
         }, {
             text: '录入日期',
             dataIndex: 'createTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }, {
             text: '更新人ID',
             dataIndex: 'updaterId',
-            width: 0
+            hidden:true
         }, {
             text: '更新人',
             dataIndex: 'updater',
-            width: 0
+            hidden:true
         }, {
             text: '更新日期',
             dataIndex: 'updateTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }],
         relativeColumn: [
         {

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

@@ -130,25 +130,25 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         },{
             text: '录入人ID',
             dataIndex: 'creatorId',
-            width: 0
+            hidden:true
         }, {
             text: '录入日期',
             dataIndex: 'createTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }, {
             text: '更新人ID',
             dataIndex: 'updaterId',
-            width: 0
+            hidden:true
         }, {
             text: '更新人',
             dataIndex: 'updaterName',
-            width: 0
+            hidden:true
         }, {
             text: '更新日期',
             dataIndex: 'updateTime',
             xtype: 'datecolumn',
-            width: 0
+            hidden:true
         }],
         relativeColumn: [{
             text: 'id',

+ 11 - 2
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -21,7 +21,8 @@ Ext.define('saas.view.sale.sale.FormPanel', {
      _auditUrl:'/api/sale/sale/audit/',
      _unAuditUrl: '/api/sale/sale/unAudit/',
      _deleteUrl:'/api/sale/sale/delete/',
-     _turnOutUrl:'/api/sale/sale/turnProdOut/', 
+     _turnOutUrl:'/api/sale/sale/turnProdOut/',
+     _turnPurchase:'/api/sale/sale/saleTurnPurchase/',
      initId:0,
  
      toolBtns: [{
@@ -32,6 +33,14 @@ Ext.define('saas.view.sale.sale.FormPanel', {
          bind: {
              hidden: '{sa_statuscode!="AUDITED"}'
          }
+     },{
+         xtype: 'button',
+         text: '转采购单',
+         hidden: true,
+         handler: 'turnPurchase',
+         bind: {
+             hidden: '{sa_statuscode!="AUDITED"}'
+         }
      }],
 
     defaultItems: [{
@@ -89,7 +98,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "sd_prodid", 

+ 26 - 1
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -82,5 +82,30 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
             console.error(res);
             saas.util.BaseUtil.showToast('转单失败: ' + res.message);
         });
-     }
+     },
+    turnPurchase : function(){
+        var me = this,
+            form = me.getView(),
+            id = form.getForm().findField(form._idField);
+        saas.util.BaseUtil.request({
+            url: form._turnPurchase+id.value,
+            method: 'POST',
+        })
+            .then(function(localJson) {
+                if(localJson.success){
+                    var intValue = localJson.data.id,
+                        codeValue= localJson.data.code,
+                        name = localJson.data.name;
+                    saas.util.BaseUtil.openTab('purchase-purchase-formpanel',name+"("+codeValue+")",codeValue+intValue, {
+                        initId: intValue
+                    });
+                    saas.util.BaseUtil.showToast('转单成功');
+                    saas.util.FormUtil.loadData(form);
+                }
+            })
+            .catch(function(res) {
+                console.error(res);
+                saas.util.BaseUtil.showToast('转单失败: ' + res.message);
+            });
+    }
 });

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

@@ -87,7 +87,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'sa_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '销售单号',
@@ -145,7 +145,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         relativeColumn: [ {
             text: 'id',
             dataIndex: 'sa_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

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

@@ -72,7 +72,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "pd_prodid", 

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

@@ -74,7 +74,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -125,7 +125,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         relativeColumn: [{
             text: 'id',
             dataIndex: 'pu_id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

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

@@ -81,7 +81,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn",
-                width:0
+                hidden:true
             }, {
                 text : "物料id", 
                 dataIndex : "pd_prodid", 

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

@@ -76,7 +76,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -122,7 +122,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         relativeColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',

+ 45 - 40
frontend/saas-web/app/view/sys/feedback/FormPanel.js

@@ -14,47 +14,52 @@ Ext.define('saas.view.sys.feedback.FormPanel', {
     fieldDefaults: {
         margin: '0 0 10 0',
         labelAlign: 'right',
-        labelWidth: 90,
-        columnWidth: 0.25,
+        labelWidth: 70,
+        columnWidth: 0.5,
     },
     bodyPadding: 10,
     border: false,
-
-    items: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        readOnly:true,
-        defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().id:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_name", 
-        fieldLabel : "姓名",
-        readOnly:true,
-       defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().realname:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_mobile", 
-        fieldLabel : "手机号",
-       defaultVale:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().mobile:null
-    }, {
-        xtype : "textfield", 
-        name : "fb_QQ", 
-        fieldLabel : "QQ"
-    }, {
-        xtype : "textfield", 
-        name : "fb_wechat", 
-        fieldLabel : "微信"
-    }, {
-        xtype : "htmleditor", 
-        name : "fb_msg", 
-        fieldLabel : "反馈内容",
-        flex: 1
-    }],buttons: [{
-        text: '提交',
-        handler:'onSubmit'
-    },{
-        text: '关闭',
-        handler:'onClose'
-    }]
+    initComponent: function () {
+        var me = this;
+        me.items = [{
+            xtype: 'hidden',
+            name: 'id',
+            fieldLabel: 'id',
+            readOnly:true,
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().id:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_name", 
+            fieldLabel : "姓名",
+            readOnly:true,
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().realname:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_mobile", 
+            fieldLabel : "手机号",
+            value:saas.util.BaseUtil.getCurrentUser() ? saas.util.BaseUtil.getCurrentUser().mobile:null
+        }, {
+            xtype : "textfield", 
+            name : "fb_QQ", 
+            fieldLabel : "QQ"
+        }, {
+            xtype : "textfield", 
+            name : "fb_wechat", 
+            fieldLabel : "微信"
+        }, {
+            xtype : "htmleditor", 
+            name : "fb_msg", 
+            fieldLabel : "反馈内容",
+            columnWidth: 1
+        }];
+        me.buttons = [{
+            text: '提交',
+            handler:'onSubmit'
+        },{
+            text: '关闭',
+            handler:'onClose'
+        }];
+        me.callParent(arguments);
+    }
+    
 });

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

@@ -168,6 +168,7 @@ Ext.define('saas.view.viewport.ViewportController', {
                 })
                 .then(function() {
                     view.isMasked() && view.unmask();
+                    window.location.reload();
                 }); 
         }        
     }

+ 2 - 3
frontend/saas-web/resources/json/navigation.json

@@ -220,10 +220,9 @@
             "viewType": "other-bankinformation",
             "leaf": true
         },{
-            "id":"employee-list-formpanel",
+            "id":"other-employee",
             "text": "人员资料",
-            "viewType": "document-employee-basepanel",
-            "addType":"document-employee-formpanel",
+            "viewType": "other-employee",
             "leaf": true
         }]
     }, {