Browse Source

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

guq 7 years ago
parent
commit
0768388500
34 changed files with 2510 additions and 286 deletions
  1. 17 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  2. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  3. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  4. 22 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/WarehouseServiceImpl.java
  5. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java
  6. 781 1
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  7. 14 3
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/WarehouseTest.java
  8. 11 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  9. 14 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  10. 38 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  11. 8 1
      frontend/saas-web/app/util/FormUtil.js
  12. 84 4
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  13. 1 0
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  14. 271 0
      frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js
  15. 57 0
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  16. 3 0
      frontend/saas-web/app/view/core/form/FormPanel.js
  17. 10 0
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  18. 25 16
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  19. 131 43
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  20. 7 9
      frontend/saas-web/app/view/main/MainModel.js
  21. 62 46
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  22. 2 2
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  23. 1 5
      frontend/saas-web/app/view/purchase/purchase/QueryPanelModel.js
  24. 61 89
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  25. 58 57
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  26. 1 5
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelModel.js
  27. 147 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormController.js
  28. 7 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormModel.js
  29. 246 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  30. 219 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  31. 115 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js
  32. 4 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelModel.js
  33. 73 1
      frontend/saas-web/app/view/test/order/FormController.js
  34. 2 2
      frontend/saas-web/app/view/test/order/FormPanel.js

+ 17 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -29,9 +29,25 @@ public class WarehouseController {
         return Result.success(map.get("result"));
     }
 
+    /**
+     * 保存
+     * @param data
+     * @return
+     */
     @PostMapping("/save")
     public Result saveFormData(@RequestBody Warehouse data){
-        boolean result = warehouseService.save(data);
+        warehouseService.insertSelective(data);
+        return Result.success();
+    }
+
+    /**
+     * 账期校验
+     * @param period
+     * @return
+     */
+    @PostMapping("/valid/period")
+    public Result validPeriod(String period){
+        boolean result = warehouseService.validPeriod(period);
         return Result.success(result);
     }
 }

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -4,12 +4,13 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
 
 import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.entities.Vendor;
 
 import java.util.List;
 
 public interface VendorMapper extends CommonBaseMapper<Vendor> {
 
-    List<Vendor> getVendorsByCondition(DocReqDTO docReqDTO);
+    List<VendorDTO> getVendorsByCondition(DocReqDTO docReqDTO);
 
 }

+ 13 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java

@@ -9,4 +9,17 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
 
     void callProcedure(Map<String, Object> map);
 
+    Short validPeriod(Map<String, Object> map);
+
+    int deleteByPrimaryKey(Integer wh_id);
+
+    int insert(Warehouse record);
+
+    int insertSelective(Warehouse record);
+
+    Warehouse selectByPrimaryKey(Integer wh_id);
+
+    int updateByPrimaryKeySelective(Warehouse record);
+
+    int updateByPrimaryKey(Warehouse record);
 }

+ 22 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/WarehouseServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service.Impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 
@@ -8,6 +9,7 @@ import com.usoftchina.saas.document.service.WarehouseService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.Map;
 
 @Service
@@ -21,4 +23,24 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         warehouseMapper.callProcedure(map);
     }
 
+    @Override
+    public boolean validPeriod(String period) {
+        long companyId = BaseContextHolder.getCompanyId();
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("companyId", companyId);
+        map.put("period", period);
+        Short status = warehouseMapper.validPeriod(map);
+        if(status != null && status == 0){
+            return true;
+        }else{
+            return false;
+        }
+    }
+
+    @Override
+    public int insertSelective(Warehouse record) {
+        int count = warehouseMapper.insertSelective(record);
+        return count;
+    }
+
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java

@@ -11,4 +11,7 @@ public interface WarehouseService extends CommonBaseService<WarehouseMapper, War
 
     void callProcedure(Map<String, Object> map);
 
+    boolean validPeriod(String periods);
+
+    int insertSelective(Warehouse record);
 }

+ 781 - 1
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -30,6 +30,786 @@
         <parameter property="companyid" jdbcType="INTEGER" mode="IN" />
         <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
     </parameterMap>
-    
+
+    <select id="validPeriod" parameterType="map" resultType="java.lang.Short">
+        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
+    </select>
+
+    <sql id="Example_Where_Clause">
+        <where>
+            <foreach collection="oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Update_By_Example_Where_Clause">
+        <where>
+            <foreach collection="example.oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Base_Column_List">
+        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
+        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5
+    </sql>
+    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
+        select
+        <if test="distinct">
+            distinct
+        </if>
+        <include refid="Base_Column_List" />
+        from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+        <if test="orderByClause != null">
+            order by ${orderByClause}
+        </if>
+    </select>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from warehouse
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from warehouse
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
+        delete from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse (wh_id, wh_code, wh_type,
+        wh_description, wh_statuscode, wh_status,
+        wh_recorderid, wh_recorder, wh_date,
+        companyid, updaterId, updatetime,
+        wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5)
+        values (#{wh_id,jdbcType=INTEGER}, #{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
+        #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
+        #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
+        #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
+        #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="wh_id != null">
+                wh_id,
+            </if>
+            <if test="wh_code != null">
+                wh_code,
+            </if>
+            <if test="wh_type != null">
+                wh_type,
+            </if>
+            <if test="wh_description != null">
+                wh_description,
+            </if>
+            <if test="wh_statuscode != null">
+                wh_statuscode,
+            </if>
+            <if test="wh_status != null">
+                wh_status,
+            </if>
+            <if test="wh_recorderid != null">
+                wh_recorderid,
+            </if>
+            <if test="wh_recorder != null">
+                wh_recorder,
+            </if>
+            <if test="wh_date != null">
+                wh_date,
+            </if>
+            <if test="companyid != null">
+                companyid,
+            </if>
+            <if test="updaterId != null">
+                updaterId,
+            </if>
+            <if test="updatetime != null">
+                updatetime,
+            </if>
+            <if test="wh_text1 != null">
+                wh_text1,
+            </if>
+            <if test="wh_text2 != null">
+                wh_text2,
+            </if>
+            <if test="wh_text3 != null">
+                wh_text3,
+            </if>
+            <if test="wh_text4 != null">
+                wh_text4,
+            </if>
+            <if test="wh_text5 != null">
+                wh_text5,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="wh_id != null">
+                #{wh_id,jdbcType=INTEGER},
+            </if>
+            <if test="wh_code != null">
+                #{wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_type != null">
+                #{wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_description != null">
+                #{wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_statuscode != null">
+                #{wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_status != null">
+                #{wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorderid != null">
+                #{wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorder != null">
+                #{wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_date != null">
+                #{wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterId != null">
+                #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="wh_text1 != null">
+                #{wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text2 != null">
+                #{wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text3 != null">
+                #{wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text4 != null">
+                #{wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text5 != null">
+                #{wh_text5,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
+        select count(*) from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </select>
+    <update id="updateByExampleSelective" parameterType="map">
+        update warehouse
+        <set>
+            <if test="record.wh_id != null">
+                wh_id = #{record.wh_id,jdbcType=INTEGER},
+            </if>
+            <if test="record.wh_code != null">
+                wh_code = #{record.wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_type != null">
+                wh_type = #{record.wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_description != null">
+                wh_description = #{record.wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_statuscode != null">
+                wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_status != null">
+                wh_status = #{record.wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_recorderid != null">
+                wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_recorder != null">
+                wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_date != null">
+                wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.companyid != null">
+                companyid = #{record.companyid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updaterId != null">
+                updaterId = #{record.updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="record.updatetime != null">
+                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.wh_text1 != null">
+                wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text2 != null">
+                wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text3 != null">
+                wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text4 != null">
+                wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text5 != null">
+                wh_text5 = #{record.wh_text5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByExample" parameterType="map">
+        update warehouse
+        set wh_id = #{record.wh_id,jdbcType=INTEGER},
+        wh_code = #{record.wh_code,jdbcType=VARCHAR},
+        wh_type = #{record.wh_type,jdbcType=VARCHAR},
+        wh_description = #{record.wh_description,jdbcType=VARCHAR},
+        wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
+        wh_status = #{record.wh_status,jdbcType=VARCHAR},
+        wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
+        wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
+        wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
+        companyid = #{record.companyid,jdbcType=INTEGER},
+        updaterId = #{record.updaterId,jdbcType=INTEGER},
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
+        wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
+        wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
+        wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
+        wh_text5 = #{record.wh_text5,jdbcType=VARCHAR}
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        <set>
+            <if test="wh_code != null">
+                wh_code = #{wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_type != null">
+                wh_type = #{wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_description != null">
+                wh_description = #{wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_statuscode != null">
+                wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_status != null">
+                wh_status = #{wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorderid != null">
+                wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorder != null">
+                wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_date != null">
+                wh_date = #{wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                companyid = #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterId != null">
+                updaterId = #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                updatetime = #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="wh_text1 != null">
+                wh_text1 = #{wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text2 != null">
+                wh_text2 = #{wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text3 != null">
+                wh_text3 = #{wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text4 != null">
+                wh_text4 = #{wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text5 != null">
+                wh_text5 = #{wh_text5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        set wh_code = #{wh_code,jdbcType=VARCHAR},
+        wh_type = #{wh_type,jdbcType=VARCHAR},
+        wh_description = #{wh_description,jdbcType=VARCHAR},
+        wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
+        wh_status = #{wh_status,jdbcType=VARCHAR},
+        wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
+        wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
+        wh_date = #{wh_date,jdbcType=TIMESTAMP},
+        companyid = #{companyid,jdbcType=INTEGER},
+        updaterId = #{updaterId,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{wh_text1,jdbcType=VARCHAR},
+        wh_text2 = #{wh_text2,jdbcType=VARCHAR},
+        wh_text3 = #{wh_text3,jdbcType=VARCHAR},
+        wh_text4 = #{wh_text4,jdbcType=VARCHAR},
+        wh_text5 = #{wh_text5,jdbcType=VARCHAR}
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </update>
+    <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Warehouse">
+        <id column="wh_id" jdbcType="INTEGER" property="whId" />
+        <result column="wh_code" jdbcType="VARCHAR" property="whCode" />
+        <result column="wh_type" jdbcType="VARCHAR" property="whType" />
+        <result column="wh_description" jdbcType="VARCHAR" property="whDescription" />
+        <result column="wh_statuscode" jdbcType="VARCHAR" property="whStatuscode" />
+        <result column="wh_status" jdbcType="VARCHAR" property="whStatus" />
+        <result column="wh_recorderid" jdbcType="VARCHAR" property="whRecorderid" />
+        <result column="wh_recorder" jdbcType="VARCHAR" property="whRecorder" />
+        <result column="wh_date" jdbcType="TIMESTAMP" property="whDate" />
+        <result column="companyid" jdbcType="INTEGER" property="companyid" />
+        <result column="updaterId" jdbcType="INTEGER" property="updaterid" />
+        <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
+        <result column="wh_text1" jdbcType="VARCHAR" property="whText1" />
+        <result column="wh_text2" jdbcType="VARCHAR" property="whText2" />
+        <result column="wh_text3" jdbcType="VARCHAR" property="whText3" />
+        <result column="wh_text4" jdbcType="VARCHAR" property="whText4" />
+        <result column="wh_text5" jdbcType="VARCHAR" property="whText5" />
+    </resultMap>
+    <sql id="Example_Where_Clause">
+        <where>
+            <foreach collection="oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Update_By_Example_Where_Clause">
+        <where>
+            <foreach collection="example.oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Base_Column_List">
+        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
+        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5
+    </sql>
+    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
+        select
+        <if test="distinct">
+            distinct
+        </if>
+        <include refid="Base_Column_List" />
+        from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+        <if test="orderByClause != null">
+            order by ${orderByClause}
+        </if>
+    </select>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from warehouse
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from warehouse
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
+        delete from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse (wh_id, wh_code, wh_type,
+        wh_description, wh_statuscode, wh_status,
+        wh_recorderid, wh_recorder, wh_date,
+        companyid, updaterId, updatetime,
+        wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5)
+        values (#{whId,jdbcType=INTEGER}, #{whCode,jdbcType=VARCHAR}, #{whType,jdbcType=VARCHAR},
+        #{whDescription,jdbcType=VARCHAR}, #{whStatuscode,jdbcType=VARCHAR}, #{whStatus,jdbcType=VARCHAR},
+        #{whRecorderid,jdbcType=VARCHAR}, #{whRecorder,jdbcType=VARCHAR}, #{whDate,jdbcType=TIMESTAMP},
+        #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{whText1,jdbcType=VARCHAR}, #{whText2,jdbcType=VARCHAR}, #{whText3,jdbcType=VARCHAR},
+        #{whText4,jdbcType=VARCHAR}, #{whText5,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="whId != null">
+                wh_id,
+            </if>
+            <if test="whCode != null">
+                wh_code,
+            </if>
+            <if test="whType != null">
+                wh_type,
+            </if>
+            <if test="whDescription != null">
+                wh_description,
+            </if>
+            <if test="whStatuscode != null">
+                wh_statuscode,
+            </if>
+            <if test="whStatus != null">
+                wh_status,
+            </if>
+            <if test="whRecorderid != null">
+                wh_recorderid,
+            </if>
+            <if test="whRecorder != null">
+                wh_recorder,
+            </if>
+            <if test="whDate != null">
+                wh_date,
+            </if>
+            <if test="companyid != null">
+                companyid,
+            </if>
+            <if test="updaterid != null">
+                updaterId,
+            </if>
+            <if test="updatetime != null">
+                updatetime,
+            </if>
+            <if test="whText1 != null">
+                wh_text1,
+            </if>
+            <if test="whText2 != null">
+                wh_text2,
+            </if>
+            <if test="whText3 != null">
+                wh_text3,
+            </if>
+            <if test="whText4 != null">
+                wh_text4,
+            </if>
+            <if test="whText5 != null">
+                wh_text5,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="whId != null">
+                #{whId,jdbcType=INTEGER},
+            </if>
+            <if test="whCode != null">
+                #{whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="whType != null">
+                #{whType,jdbcType=VARCHAR},
+            </if>
+            <if test="whDescription != null">
+                #{whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatuscode != null">
+                #{whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatus != null">
+                #{whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorderid != null">
+                #{whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorder != null">
+                #{whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="whDate != null">
+                #{whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterid != null">
+                #{updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="whText1 != null">
+                #{whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="whText2 != null">
+                #{whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="whText3 != null">
+                #{whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="whText4 != null">
+                #{whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="whText5 != null">
+                #{whText5,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
+        select count(*) from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </select>
+    <update id="updateByExampleSelective" parameterType="map">
+        update warehouse
+        <set>
+            <if test="record.whId != null">
+                wh_id = #{record.whId,jdbcType=INTEGER},
+            </if>
+            <if test="record.whCode != null">
+                wh_code = #{record.whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whType != null">
+                wh_type = #{record.whType,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whDescription != null">
+                wh_description = #{record.whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whStatuscode != null">
+                wh_statuscode = #{record.whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whStatus != null">
+                wh_status = #{record.whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whRecorderid != null">
+                wh_recorderid = #{record.whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whRecorder != null">
+                wh_recorder = #{record.whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whDate != null">
+                wh_date = #{record.whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.companyid != null">
+                companyid = #{record.companyid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updaterid != null">
+                updaterId = #{record.updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updatetime != null">
+                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.whText1 != null">
+                wh_text1 = #{record.whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText2 != null">
+                wh_text2 = #{record.whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText3 != null">
+                wh_text3 = #{record.whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText4 != null">
+                wh_text4 = #{record.whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText5 != null">
+                wh_text5 = #{record.whText5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByExample" parameterType="map">
+        update warehouse
+        set wh_id = #{record.whId,jdbcType=INTEGER},
+        wh_code = #{record.whCode,jdbcType=VARCHAR},
+        wh_type = #{record.whType,jdbcType=VARCHAR},
+        wh_description = #{record.whDescription,jdbcType=VARCHAR},
+        wh_statuscode = #{record.whStatuscode,jdbcType=VARCHAR},
+        wh_status = #{record.whStatus,jdbcType=VARCHAR},
+        wh_recorderid = #{record.whRecorderid,jdbcType=VARCHAR},
+        wh_recorder = #{record.whRecorder,jdbcType=VARCHAR},
+        wh_date = #{record.whDate,jdbcType=TIMESTAMP},
+        companyid = #{record.companyid,jdbcType=INTEGER},
+        updaterId = #{record.updaterid,jdbcType=INTEGER},
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{record.whText1,jdbcType=VARCHAR},
+        wh_text2 = #{record.whText2,jdbcType=VARCHAR},
+        wh_text3 = #{record.whText3,jdbcType=VARCHAR},
+        wh_text4 = #{record.whText4,jdbcType=VARCHAR},
+        wh_text5 = #{record.whText5,jdbcType=VARCHAR}
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        <set>
+            <if test="whCode != null">
+                wh_code = #{whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="whType != null">
+                wh_type = #{whType,jdbcType=VARCHAR},
+            </if>
+            <if test="whDescription != null">
+                wh_description = #{whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatuscode != null">
+                wh_statuscode = #{whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatus != null">
+                wh_status = #{whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorderid != null">
+                wh_recorderid = #{whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorder != null">
+                wh_recorder = #{whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="whDate != null">
+                wh_date = #{whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                companyid = #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterid != null">
+                updaterId = #{updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                updatetime = #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="whText1 != null">
+                wh_text1 = #{whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="whText2 != null">
+                wh_text2 = #{whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="whText3 != null">
+                wh_text3 = #{whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="whText4 != null">
+                wh_text4 = #{whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="whText5 != null">
+                wh_text5 = #{whText5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        set wh_code = #{whCode,jdbcType=VARCHAR},
+        wh_type = #{whType,jdbcType=VARCHAR},
+        wh_description = #{whDescription,jdbcType=VARCHAR},
+        wh_statuscode = #{whStatuscode,jdbcType=VARCHAR},
+        wh_status = #{whStatus,jdbcType=VARCHAR},
+        wh_recorderid = #{whRecorderid,jdbcType=VARCHAR},
+        wh_recorder = #{whRecorder,jdbcType=VARCHAR},
+        wh_date = #{whDate,jdbcType=TIMESTAMP},
+        companyid = #{companyid,jdbcType=INTEGER},
+        updaterId = #{updaterid,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{whText1,jdbcType=VARCHAR},
+        wh_text2 = #{whText2,jdbcType=VARCHAR},
+        wh_text3 = #{whText3,jdbcType=VARCHAR},
+        wh_text4 = #{whText4,jdbcType=VARCHAR},
+        wh_text5 = #{whText5,jdbcType=VARCHAR}
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </update>
+
 </mapper>
 

+ 14 - 3
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/WarehouseTest.java

@@ -22,12 +22,23 @@ public class WarehouseTest {
     @Test
     public void testCallProcedure(){
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inParam", "Hello,World!");              //入参
-        map.put("outParam", null);                      //输出结果
+        map.put("inoutNo", "YS20181018");              //入参
+        map.put("class", "采购验收单");
+        map.put("commitid", null);
+        map.put("companyid", null);
+        map.put("result", null);                      //输出结果
         warehouseService.callProcedure(map);
         //输出返回值
-        System.out.println("result:" + map.get("outParam"));
+        System.out.println("result:" + map.get("result"));
     }
 
 
+    @Test
+    public void testPeriod(){
+        long companyId = 12;
+        String period = "201810";
+        boolean valid = warehouseService.validPeriod(period);
+        System.out.println("result: " + valid);
+    }
+
 }

+ 11 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -147,4 +147,15 @@ public class PurchaseController {
         return Result.success();
     }
 
+    @PostMapping("/close/{id}")
+    public Result closePurchase(@PathVariable(value = "id") long id){
+        purchaseService.closePurchase(id);
+        return Result.success();
+    }
+
+    @PostMapping("/open/{id}")
+    public Result openPurchase(@PathVariable(value = "id") long id){
+        purchaseService.openPurchase(id);
+        return Result.success();
+    }
 }

+ 14 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -109,4 +109,18 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
     * @Date: 2018/10/17 
     */
     void batchUnAudit(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 采购单关闭
+     * @param id
+     * @Author: chenwei
+     * @Date: 20181018
+     */
+    void closePurchase(long id);
+
+    /**
+     * 采购单恢复
+     * @param id
+     */
+    void openPurchase(long id);
 }

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

@@ -229,6 +229,44 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
     }
 
+    @Override
+    public void closePurchase(long id) {
+        Purchase purchase = new Purchase();
+        purchase.setId(id);
+        purchase.setPu_acceptstatuscode("CLOSED");
+        purchase.setPu_acceptstatus("已关闭");
+        purchaseMapper.updateByPrimaryKeySelective(purchase);
+    }
+
+    @Override
+    public void openPurchase(long id) {
+        List<PurchaseDetail> purchaseDetailList = purchasedetailMapper.selectByFK(id);
+        int partTurnCount = 0,turnCount = 0;            //部分入库、全部入库
+        if(purchaseDetailList != null && purchaseDetailList.size() > 0){
+            for(PurchaseDetail purchaseDetail : purchaseDetailList){
+                if(purchaseDetail.getPd_acceptqty() >= purchaseDetail.getPd_qty()){     //入库数大于等于采购数
+                    turnCount++;
+                }else if(purchaseDetail.getPd_acceptqty() > 0 && purchaseDetail.getPd_acceptqty() < purchaseDetail.getPd_qty()){    //     0 < 入库数 < 采购数
+                    partTurnCount++;
+                }
+            }
+            //构造更新对象
+            Purchase purchase = new Purchase();
+            purchase.setId(id);
+            purchase.setPu_acceptstatuscode("UNTURNIN");
+            purchase.setPu_acceptstatus("未入库");
+            if(partTurnCount > 0){
+                purchase.setPu_acceptstatuscode("PART2IN");
+                purchase.setPu_acceptstatus("部分入库");
+            }
+            if(turnCount == purchaseDetailList.size()){
+                purchase.setPu_acceptstatus("已入库");
+                purchase.setPu_acceptstatuscode("TURNIN");
+            }
+            purchaseMapper.updateByPrimaryKeySelective(purchase);
+        }
+    }
+
     private void singleAudit(Long id) {
         Purchase purchase = new Purchase();
         //生成更新对象

+ 8 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -126,7 +126,14 @@ Ext.define('saas.util.FormUtil', {
         }else{
             var viewModel = form.getViewModel();
             var detailStore = viewModel.get('_detailStore');
-            detailStore.loadData([{},{},{},{},{},{},{},{},{},{}]);
+            var detno = 0,datas=[];
+            Ext.Array.each(new Array(10), function() {
+                detno += 1;
+                var data = {};
+                data[form._detnoColumn] = detno;
+                datas.push(data);
+            })
+            detailStore.loadData(datas);
         }
     }
 });

+ 84 - 4
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -1,18 +1,84 @@
 Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
-    extend: 'saas.view.core.grid.GridPanel',
+    extend: 'Ext.grid.Panel',
     xtype: 'dbfindgridpanel',
     GridUtil: Ext.create('saas.util.GridUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     dataUrl: '',
+    dbSearchFields: [],
+    condition:'',
 
     initComponent: function() {
         var me = this;
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 6,
+                data: [],
+                proxy: {
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = " 1=1 ";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            keyword: condition
+                        });
+                    }
+                }
+            });
+
             Ext.apply(me, {
-                store:Ext.create('Ext.data.Store', {
-                    fields:fields
-                })
+                dockedItems:[{
+                    xtype:'toolbar',
+                    dock:'top',
+                    items:me.dbSearchFields.concat([{
+                        xtype:'button',
+                        text:'查询',
+                        handler:function(b){
+                            var grid = me;
+                            grid.condition = '';
+                            var fields = grid.dbSearchFields;
+                            Ext.Array.each(fields,function(f) {
+                                var field = b.ownerCt.down('[name='+f.name+']')
+                                var c = grid.getCondition(field,f.conditionExpression);
+                                grid.condition+=c;
+                            });
+                            debugger
+                            if(grid.condition.length>0){
+                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
+                            }
+                            grid.store.loadPage(1);
+                        }
+                    },'->',{
+                        xtype:'button',
+                        text:'新增'
+                    }])
+                },{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
             });
         }
         me.callParent(arguments);
@@ -70,5 +136,19 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
             }
             me.ownerCt.close();
         }
+    },
+
+    getCondition: function(f,conditionExpression){
+        debugger
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
     }
 });

+ 1 - 0
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -35,6 +35,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 dataUrl: f.dataUrl,
                 dbfinds: f.dbfinds,
                 belong: f.belong,
+                dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
                 dbfindtrigger:f
             }]
         });

+ 271 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -0,0 +1,271 @@
+Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'multidbfindgridpanel',
+    GridUtil: Ext.create('saas.util.GridUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    dataUrl: '',
+    dbSearchFields: [],
+    condition:'',
+    selectRecordArr:[],
+
+    selModel: {
+        checkOnly:true,
+        type:'checkboxmodel',
+        ignoreRightMouseSelection : false,
+        listeners:{
+            select:function(selModel,record,c,d){
+                var selectRecordArr = selModel.view.ownerCt.selectRecordArr;
+                selectRecordArr.push(record);
+            },
+            deselect:function(selModel,record){
+                var selectRecordArr = selModel.view.ownerCt.selectRecordArr;
+                var index = -1;
+                index = selectRecordArr.findIndex(function(f){
+                    return f.id==record.id
+                });
+                if(index>-1){
+                    selectRecordArr.splice(index,1);
+                }
+            }
+        },
+	    onHeaderClick: function(headerCt, header, e) {
+            console.log('header click');
+	        if (header.isCheckerHd) {
+	            e.stopEvent();
+	            var isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');
+	            if (isChecked && this.getSelection().length > 0) {//先全选,再筛选后再全选时,无法响应的bug
+	                this.deselectAll(true);
+	            } else {
+	                this.selectAll(true);
+	                this.view.ownerCt.selectall = true;
+	            }
+            }
+	    }
+	},
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 6,
+                data: [],
+                proxy: {
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = " 1=1 ";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            keyword: condition
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype:'toolbar',
+                    dock:'top',
+                    items:me.dbSearchFields.concat([{
+                        xtype:'button',
+                        text:'查询',
+                        handler:function(b){
+                            var grid = me;
+                            grid.condition = '';
+                            var fields = grid.dbSearchFields;
+                            Ext.Array.each(fields,function(f) {
+                                var field = b.ownerCt.down('[name='+f.name+']')
+                                var c = grid.getCondition(field,f.conditionExpression);
+                                grid.condition+=c;
+                            });
+                            if(grid.condition.length>0){
+                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
+                            }
+                            grid.store.loadPage(1);
+                        }
+                    },'->',{
+                        xtype:'button',
+                        text:'新增'
+                    }])
+                },{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页",
+                    items:[{
+                        xtype:'checkbox',
+                        id:'showSelectRecord',
+                        boxLabel:'显示选中数据',
+                        handler:function(b){
+                            var grid = me;
+                            if(b.checked){
+                                grid.store.loadData(grid.selectRecordArr);
+                            }else{
+                                grid.store.loadPage(1);
+                            }
+                        }
+                    }],
+                    moveFirst: function() {
+                        //if(Ext.getCmp('showSelectRecord').checked==false){
+                            if (this.fireEvent('beforechange', this, 1) !== false) {
+                                this.store.loadPage(1);
+                                return true;
+                            }
+                        //}
+                        return false;
+                    },
+                    movePrevious: function() {
+                        var me = this,
+                            store = me.store,
+                            prev = store.currentPage - 1;
+                        if (prev > 0) {
+                            if (me.fireEvent('beforechange', me, prev) !== false) {
+                                store.previousPage();
+                                return true;
+                            }
+                        }
+                        return false;
+                    },
+                    moveNext: function() {
+                        var me = this,
+                            store = me.store,
+                            total = me.getPageData().pageCount,
+                            next = store.currentPage + 1;
+                        if (next <= total) {
+                            if (me.fireEvent('beforechange', me, next) !== false) {
+                                store.nextPage();
+                                return true;
+                            }
+                        }
+                        return false;
+                    },
+                    moveLast: function() {
+                        var me = this,
+                            last = me.getPageData().pageCount;
+                        if (me.fireEvent('beforechange', me, last) !== false) {
+                            me.store.loadPage(last);
+                            return true;
+                        }
+                        return false;
+                    },
+                    doRefresh: function() {
+                        var me = this,
+                            store = me.store,
+                            current = store.currentPage;
+                        if (me.fireEvent('beforechange', me, current) !== false) {
+                            store.loadPage(current);
+                            return true;
+                        }
+                        return false;
+                    },
+                    updateInfo: function() {
+                        var me = this,
+                            displayItem = me.child('#displayItem'),
+                            store = me.store,
+                            pageData = me.getPageData(),
+                            count, msg;
+                        if (displayItem) {
+                            count = store.getCount();
+                            if (count === 0) {
+                                msg = me.emptyMsg;
+                            } else {
+                                msg = Ext.String.format(me.displayMsg, pageData.fromRecord, pageData.toRecord, pageData.total);
+                            }
+                            displayItem.setText(msg);
+                        }
+                    }
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    loadData: function(grid, url) {
+        this.BaseUtil.request({url})
+        .then(function(response) {
+            var data = Ext.decode(response.responseText);
+                grid.getStore().loadData(data.data);
+                grid.fireEvent('afterLoadData', grid, data.data);
+                grid.setLoading(false);
+        })
+        .catch(function(response) {
+            // something...
+        });
+    },
+
+    listeners:{
+        afterrender:function(grid){
+            if(grid.dataUrl){
+                grid.setLoading(true);
+                grid.loadData(grid, grid.dataUrl);
+            }
+        }//,
+        // itemClick: function(view,record) {
+        //     var me = this;
+        //     var dbfinds = me.dbfinds;
+        //     if(dbfinds&&dbfinds.length>0){
+        //         if(me.belong=='grid'){
+        //             for (let index = 0; index < dbfinds.length; index++) {
+        //                 var item = dbfinds[index];
+        //                 var rec = me.dbfindtrigger.column.ownerCt.ownerCt.selModel.getLastSelected();
+        //                 if(rec){
+        //                     var nowRec = me.dbfindtrigger.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+        //                     nowRec.set(item.to,record.get(item.from));
+        //                     //me.column.getEditor().setValue(record.get(item.from));
+        //                 }
+        //             }
+        //         }else if(me.belong=='form'){
+        //             for (let index = 0; index < dbfinds.length; index++) {
+        //                 var item = dbfinds[index];
+        //                 var field = me.ownerCt.belong.down('[name='+item.to+']');
+        //                 if(field){
+        //                     var val = record.get(item.from);
+        //                     if(field.xtype=='dbfindtrigger'){
+        //                         field.setValue(val);
+        //                         field.lastTriggerValue=val;
+        //                     }else{
+        //                         field.setValue(val);
+        //                     }    
+        //                 }
+        //             }
+        //         }
+        //     }
+        //     me.ownerCt.close();
+        // }
+    },
+
+    getCondition: function(f,conditionExpression){
+        debugger
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
+    }
+});

+ 57 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -0,0 +1,57 @@
+/**
+ *  multi dbfind trigger
+ * 改了下MultiDbfindTrigger的赋值方式,在grid中也会把多选的值用#号连接
+ */
+Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
+	extend: 'Ext.form.field.Trigger',
+	alias: 'widget.multidbfindtrigger',
+	triggerCls: 'x-form-search-trigger',
+    GridUtil: Ext.create('saas.util.GridUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    minChars:1, // 设置用户输入字符多少时触发查询
+    tpl: '',
+    enableKeyEvents:true,
+    initComponent:function() {
+        var me = this;
+        this.callParent(arguments);
+    },
+    onTriggerClick:function(f){
+        //判断dbfindtrigger归属
+        var belong = f.judge(f);
+        var win = Ext.create('Ext.window.Window', {   
+            trigger:f,
+            belong:f.ownerCt,  
+            modal:true,
+            height: '80%',
+            width: '80%',
+            title: '查找',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            renderTo:Ext.getCmp('main-tab-panel').getActiveTab().getEl(),
+            items:[{
+                xtype:'multidbfindgridpanel',
+                columns: f.dbColumns,
+                dataUrl: f.dataUrl,
+                dbfinds: f.dbfinds,
+                belong: f.belong,
+                dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
+                dbfindtrigger:f
+            }]
+        });
+        win.show();
+    },
+
+    judge:function(f){
+        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+            f.belong = 'form';
+            return 'form'
+        }
+        else if(f.column){
+            f.belong = 'grid';
+            return 'grid'
+        }
+    }
+});

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

@@ -62,6 +62,9 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }, {
                     xtype: 'button',
                     text: '删除',
+                    bind: {
+                        hidden: '{deleteHidden}'
+                    },
                     handler: 'delete'
                 }, {
                     xtype: 'button',

+ 10 - 0
frontend/saas-web/app/view/core/form/FormPanelModel.js

@@ -3,8 +3,18 @@ Ext.define('saas.view.core.form.FormPanelModel', {
     alias: 'viewmodel.core-form-formpanel',
 
     data: {
+        id:0,
         _bindFields: [], // 主表绑定字段,绑定到formfield并且未设置ignore为true
         _detailBindeFields: [], // 从表绑定列
         _detailStore: null, // 从表store
     },
+
+    formulas:{
+        deleteHidden:{
+            bind:'{id}',
+            get:function(value){
+                return !value;
+            }
+        }
+    }
 });

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

@@ -92,7 +92,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 dock: 'bottom'
             });
         }
-        Ext.apply(me, {
+        Ext.applyIf(me, {
             features: features
         });
     },
@@ -121,17 +121,20 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             form = me.ownerCt,
             detnoColumn = form._detnoColumn,
             store = me.getStore(),
-            selectedRecord = me.selModel.lastSelected;
+            selectedRecord = me.selModel.lastSelected,
+            detno = 0;
 
         //当前行后序号全部加1
-        var detno = selectedRecord.data[form._detnoColumn];
-        var store = me.store;
-        store.each(function(item){
-            d = item.data[detnoColumn];
-            if(Number(d) > detno) {
-                item.set(detnoColumn, Number(d) + 1);
-            }
-        });
+        if(selectedRecord){
+            detno = selectedRecord.data[form._detnoColumn];
+            var store = me.store;
+            store.each(function(item){
+                d = item.data[detnoColumn];
+                if(Number(d) > detno) {
+                    item.set(detnoColumn, Number(d) + 1);
+                }
+            });
+        }
         var data = {};
         data[detnoColumn] = detno + 1;
         store.insert(store.indexOf(selectedRecord) + 1, data);
@@ -169,11 +172,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     swapUp: function() {
         var me = this,
-            store = me.getStore(),
-            record = me.selModel.lastSelected,
-            selectedIdx = store.indexOf(record);
-            
-            me.swap(record, selectedIdx, -1);
+        store = me.getStore(),
+        record = me.selModel.lastSelected,
+        selectedIdx = store.indexOf(record);
+
+        me.swap(record, selectedIdx, -1);
     },
 
     swapDown: function() {
@@ -187,11 +190,17 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     swap: function(from, index, dir) {
         var me = this,
+        form = me.ownerCt,
         store = me.getStore(),
         to = store.getAt(index + dir);
 
         if(from && to) {
-            var keys = me.getColumns().map(function(c) { return c.dataIndex }),
+            var keys = me.getColumns().map(function(c) {
+                //剔除序号字段
+                if(c.dataIndex!=form._detnoColumn){
+                    return c.dataIndex 
+                }
+            }),
             data = from.getData(),
             toData = to.getData();
 

+ 131 - 43
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -71,21 +71,91 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
+                defaults: { // defaults 将会应用所有的子组件上,而不是父容器
+                    listeners: {
+                        'mouseover':function(){
+                            this.showMenu(); 
+                        },
+                        'mouseout':function(btn,e){
+                            var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
+                            var btnLayout = btn.el.dom.getBoundingClientRect();
+                            if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
+                                btn.hideMenu();
+                            }
+                        }
+                    }
+                },
                 items: ['->', {
                     text: '新增',
                     handler: me.onAddMore
                 }, {
                     text: '审核',
-                    handler: me.onAudit
-                }, {
-                    text: '反审核',
-                    handler: me.onUnAudit
+                    xtype: 'button',
+                    handler: me.onAudit,
+                    menu: {
+                        items: [{
+                            text:'反审核',
+                            handler:function(){
+                                me.onUnAudit(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '打印',
-                    handler: me.onPrint
+                    handler: me.onPrint,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'设置',
+                            handler:function(){
+                                me.onPrintSet(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
-                    text: '导出',
-                    handler: me.onExport
+                    text: '导入',
+                    handler: me.onImport,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'导出',
+                            handler:function(){
+                                me.onExport(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
+                },{
+                    text: '关闭',
+                    handler: me.onCloseOrder,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'启用',
+                            handler:function(){
+                                me.onOpenOrder(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '删除',
                     handler: me.onDelete
@@ -130,8 +200,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             return c.dataIndex;
         });
     },
-    onAddMore: function (btn) {
-        var grid = this.getGrid(btn),
+    onAddMore: function (me) {
+        var grid = me.up('grid'),
             mainTab = Ext.getCmp('main-tab-panel'),
             id = grid.xtype + '_add';
             existingItem = mainTab.down('[id=' + id + ']');
@@ -144,37 +214,55 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             mainTab.setActiveTab(mainTab.add(form));
         }
     },
-    onAudit: function(btn){
-        btn.ownerCt.ownerCt.vastOperation("batchAudit");
+    onAudit: function(me){
+        console.log('审核');
+        me.up('grid').vastOperation("batchAudit");
     },
-    onUnAudit:function(btn){
-        btn.ownerCt.ownerCt.vastOperation("batchUnAudit");
+    onUnAudit:function(me){
+        console.log('反审核');
+        me.up('grid').vastOperation("batchUnAudit");
     },
-    onPrint: function () {
+    onPrint: function (me) {
         console.log("打印");
     },
-    onExport: function () {
+    onPrintSet:function(me){
+        console.log("打印设置");
+    },
+    onImport:function(me){
+        console.log("导入");
+    },
+    onExport: function (me) {
         console.log("导出");
     },
+    onCloseOrder:function(me){
+        console.log("关闭订单");
+    },onOpenOrder:function(me){
+        console.log("开启订单");
+    },
     onDelete: function (btn) {
-        btn.ownerCt.ownerCt.vastOperation("batchDelete");
+        btn.up('grid').vastOperation("batchDelete");
     },
     vastOperation :function(type){
-        var me = this,
-        params = JSON.stringify(me.getGridSelected());
-        me.BaseUtil.request({
-                url: me._baseVastUrl+type,
-                params: params,
-                method: 'POST',
-                async:false
-            })
-            .then(function() {
-                Ext.Msg.alert('提示','操作成功');
-            })
-            .catch(function(response) {
-                Ext.Msg.alert('提示','操作失败');
-            });
-            me.getStore().loadPage(1);
+        var me = this;
+        var data = me.getGridSelected();
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            me.BaseUtil.request({
+                    url: me._baseVastUrl+type,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    Ext.Msg.alert('提示','操作成功');
+                })
+                .catch(function(response) {
+                    Ext.Msg.alert('提示','操作失败');
+                });
+                me.getStore().loadPage(1);
+        }else{
+            Ext.Msg.alert('提示','请勾选至少一条明细。');
+        }
     },
     /**
      * 获取grid被选数据
@@ -184,18 +272,18 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         var me = this,
             items = me.selModel.getSelection(),
             data = new Array() ;
-		Ext.each(items, function(item, index){
-			if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
-				var o = new Object();
-				if(me._idField){
-					o['id'] = item.data[me._idField];
-                }
-                if(me._codeField){
-					o['code'] = item.data[me._codeField];
+            Ext.each(items, function(item, index){
+                if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
+                    var o = new Object();
+                    if(me._idField){
+                        o['id'] = item.data[me._idField];
+                    }
+                    if(me._codeField){
+                        o['code'] = item.data[me._codeField];
+                    }
+                    data.push(o);
                 }
-				data.push(o);
-            }
-		});
-		return {baseDTOs:data};
+            });
+		return data;
     } 
 });

+ 7 - 9
frontend/saas-web/app/view/main/MainModel.js

@@ -28,7 +28,6 @@ Ext.define('saas.view.main.MainModel', {
                                     {
                                         id: 'purchaseOrder',
                                         text: '采购单(维护界面)',
-                                        //viewType: 'purchase-list-gridpanel',
                                         viewType:'purchase-purchase-formpanel',
                                         leaf: true
                                     },{
@@ -47,15 +46,14 @@ Ext.define('saas.view.main.MainModel', {
                                         viewType:'purchase-purchaseIn-querypanel',
                                         leaf: true
                                     },{
-                                        id: 'list1',
-                                        text: '列表界面1',
-                                        viewType: 'purchase-list-gridpanel1',
+                                        id: 'purchaseOutOrder',
+                                        text: '采购验退单(维护界面)',
+                                        viewType:'purchase-purchaseOut-formpanel',
                                         leaf: true
-                                    },
-                                    {
-                                        id: 'list2',
-                                        text: '列表界面2',
-                                        viewType: 'purchase-list-gridpanel2',
+                                    },{
+                                        id: 'purchaseOutQuery',
+                                        text: '采购验退单查询',
+                                        viewType:'purchase-purchaseOut-querypanel',
                                         leaf: true
                                     },
                                     {

+ 62 - 46
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -5,26 +5,28 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     controller: 'purchase-purchase-formcontroller',
     viewModel: 'purchase-purchase-formmodel',
     
-    _title:'采购单',
-    _codeField: 'pu_ode',
-    _statusField: 'pu_status',
-    _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
-    _detnoColumn:  'pd_detno',
-    _dataModelUrl:'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/',
-    initId:0,
-
-    toolBtns: [{
-        xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
-    }],
+     //字段属性
+     _title:'采购单',
+     _idField: 'id',
+     _codeField: 'pu_code',
+     _statusField: 'pu_status',
+     _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/',
+     initId:0,
+ 
+     toolBtns: [{
+         xtype: 'button',
+         text: '转单按钮',
+         handler: function() {
+             console.log('11');
+         }
+     }],
 
     defaultItems: [{
         xtype: 'hidden',
@@ -108,23 +110,29 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
-                dataIndex : "pdDetno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                dataIndex : "pd_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"
             },
             {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -137,39 +145,47 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
-            }, 
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            },
             {
                 text : "数量", 
                 dataIndex : "pd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
                 dataIndex : "pd_price", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
-                items : null
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 dataIndex : "pd_taxrate", 
                 width : 120.0, 
                 xtype : "numbercolumn", 

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

@@ -88,7 +88,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 0.25,
         datas: [
             ["TURNIN", "已入库"],
-            ["NOIN", "未入库"],
+            ["UNTURNIN", "未入库"],
             ["PARTIN", "部分入库"]
         ]
     }],
@@ -116,7 +116,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         _idField: 'pu_id',
         _codeField: 'pu_code',
         _title: '采购单',
-        _addXtype: 'test-order-formpanel',
+        _addXtype: 'purchase-purchase-formpanel',
         _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{
             text: '序号',

+ 1 - 5
frontend/saas-web/app/view/purchase/purchase/QueryPanelModel.js

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchase.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchase-querypanel',
+    alias: 'viewmodel.purchase-purchase-querypanel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

+ 61 - 89
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -6,17 +6,19 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     viewModel: 'purchase-purchaseIn-formmodel',
     
     _title:'采购验收单',
+    _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pu_status',
     _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
     _detnoColumn:  'pd_pdno',
-    _dataModelUrl:'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/',
-    initId:0,
+    _relationColumn: 'pd_piid',
+    _readUrl:'http://192.168.253.228:8800/prodinout/read/',
+    _saveUrl:'http://192.168.253.228:8800/prodinout/save',
+    _auditUrl:'http://192.168.253.228:8800/prodinout/audit',
+    _deleteUrl:'http://192.168.253.228:8800/prodinout/delete/',
+    _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
+   _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
+    initId:11,
 
     toolBtns: [{
         xtype: 'button',
@@ -44,95 +46,80 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         name : "pi_class", 
         bind : "{pi_class}", 
-        fieldLabel : "类型", 
+        fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         xtype : "hidden", 
-        name : "pu_vendid", 
-        bind : "{pu_vendid}", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
         fieldLabel : "供应商ID", 
         allowBlank : true, 
         columnWidth : 0.0
     }, {
         xtype : "textfield", 
-        name : "pu_vendcode", 
-        bind : "{pu_vendcode}", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
         fieldLabel : "供应商编号", 
         hidden:true,
         allowBlank : true, 
         columnWidth : 0, 
     }, {
         xtype : "dbfindtrigger", 
-        name : "pu_vendname", 
-        bind : "{pu_vendname}", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
         fieldLabel : "供应商名称", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "datefield", 
-        name : "pu_date", 
-        bind : "{pu_date}", 
-        fieldLabel : "采购日期", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
         allowBlank : false, 
         columnWidth : 0.25
-    }, {
-        xtype : "hidden", 
-        name : "pu_buyerid", 
-        bind : "{pu_buyerid}", 
-        fieldLabel : "采购员ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyercode", 
-        bind : "{pu_buyercode}", 
-        fieldLabel : "采购员编号", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    }, {
-        xtype : "dbfindtrigger", 
-        name : "pu_buyername", 
-        bind : "{pu_buyername}", 
-        fieldLabel : "采购员名称", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    }, {
+    },{
         xtype : "textfield", 
-        name : "pu_shipaddresscode", 
-        bind : "{pu_shipaddresscode}", 
-        fieldLabel : "交货地址", 
-        allowBlank : true, 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
         columnWidth : 0.25
     }, {
         xtype : "textfield", 
-        name : "pu_total", 
-        bind : "{pu_total}", 
-        fieldLabel : "单据金额", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
                 dataIndex : "pd_pdno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"
             },
             {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -145,35 +132,34 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
             }, 
             {
                 text : "数量", 
                 dataIndex : "pd_inqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "仓库", 
                 dataIndex : "pd_whname", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
                 items : null,
                 editor : {
                     displayField : "display", 
@@ -216,21 +202,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             {
                 text : "采购单号", 
                 dataIndex : "pd_ordercode", 
-                width : 120.0,
-                flex : 1.0,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "dbfindtrigger"
-                }
+                width : 120.0
             },{
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
@@ -257,8 +229,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         readOnly : true, 
         editable : false, 
-        name : "pu_status", 
-        bind : "{pu_status}", 
+        name : "pi_status", 
+        bind : "{pi_status}", 
         fieldLabel : "单据状态", 
         allowBlank : true, 
         columnWidth : 0.25
@@ -266,8 +238,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "hidden", 
         readOnly : true, 
         editable : false, 
-        name : "pu_statuscode", 
-        bind : "{pu_statuscode}", 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
         fieldLabel : "单据状态码", 
         allowBlank : true, 
         columnWidth : 0.0

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

@@ -23,29 +23,29 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'condatefield',
-        name: 'pu_date',
-        bind: '{pu_date}',
-        fieldLabel: '采购日期',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
         allowBlank: true,
         columnWidth: 0.5
     }, {
         xtype: 'textfield',
-        name: 'pu_vendcode',
-        bind: '{pu_vendcode}',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
         hidden:true,
         columnWidth: 0.25
     }, {
         xtype: 'textfield',
-        name: 'pu_vendname',
-        bind: '{pu_vendname}',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pd_prodcode#pd_prodcode',
+        name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
@@ -55,48 +55,29 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pr_detail',
+        name: 'pr_detail#pd_prodcode',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'combobox',
-        name: 'pr_statuscode',
-       // bind: '{pr_statuscode}',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-        displayField: 'pr_status',
-        valueField: 'pr_statuscode',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
         store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pr_statuscode', 'pr_status'],
+            fields: ['pi_statuscode', 'pi_status'],
             data: [
                 ["$ALL", "全部"],
                 ["AUDITED", "已审核"],
                 ["UNAUDITED", "未审核"]
             ]
         })
-    }, {
-        xtype: 'combobox',
-        name: 'pu_acceptstatuscode',
-        bind: '{pu_acceptstatuscode}',
-        fieldLabel: '入库状态',
-        allowBlank: true,
-        columnWidth: 0.25,
-        queryMode: 'local',
-        displayField: 'pu_acceptstatus',
-        valueField: 'pu_acceptstatuscode',
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            datas: [
-                ["$ALL", "全部"],
-                ["TURNOUT", "已入库"],
-                ["NOOUT", "未入库"],
-                ["PARTOUT", "部分入库"]
-            ]
-        })
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',
@@ -122,7 +103,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         _idField:'pi_id',
         _codeField:'pi_inoutno',
         _title:'采购验收单',
-        _addXtype:'test-order-formpanel',
+        _addXtype:'purchase-purchaseIn-formpanel',
         _baseVastUrl:'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{
             text: '序号',
@@ -130,67 +111,77 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             xtype: 'rownumberer'
         }, {
             text: 'id',
-            dataIndex: 'pu_id',
+            dataIndex: 'pi_id',
             width: 100,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pi_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
             width: 120
         },{
             text: '含税金额',
-            dataIndex: 'pu_taxtotal',
+            dataIndex: 'pi_total',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '金额',
-            dataIndex: 'pu_total',
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,
             flex: 1
         }],
         _relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
         }, {
             text: 'id',
             dataIndex: 'pu_id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pd_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
             width: 120
         },{
             text: '采购序号',
-            dataIndex: 'pd_detno',
+            dataIndex: 'pd_orderdetno',
             xtype:'numbercolumn',
             width: 120
         },{
@@ -198,18 +189,28 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             dataIndex: 'pd_prodcode',
             width: 120
         },{
-            text: '数量',
-            dataIndex: 'pd_qty',
+            text: '验收数量',
+            dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '单价',
-            dataIndex: 'pd_price',
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pd_total',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '已转数',
-            dataIndex: 'pd_ytqy',
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
             xtype:'numbercolumn',
             width: 120,
             flex: 1

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

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchaseIn.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchaseIn-queryformmodel',
+    alias: 'viewmodel.purchase-purchaseIn-queryformmodel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

+ 147 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormController.js

@@ -0,0 +1,147 @@
+Ext.define('saas.view.purchase.purchaseOut.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.purchase-purchaseOut-formcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        },{
+                            field:'pr_unit',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+    addCombo:function(){
+        var combo=this.ownerCmp;
+        Ext.create('Ext.window.Window',{
+            layout:'vbox',
+            bodyPadding: 15,
+            width:500,
+            items:[{
+                fieldLabel:'实际值',
+                xtype:'textfield'
+            },{
+                fieldLabel:'显示值',
+                xtype:'textfield'
+            }],
+            buttons:[{
+                text:'确认',
+                handler:function(b){
+                    combo.setValue('ok');
+                    b.up('window').close();
+                }
+            }],
+            renderTo:this.ownerCmp.ownerCt.getEl()
+        }).show();
+
+    }
+});

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

@@ -0,0 +1,7 @@
+Ext.define('saas.view.purchase.purchaseOut.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-formmodel',
+    data: {
+        pi_class: '采购验退单'
+     }
+});

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

@@ -0,0 +1,246 @@
+Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'purchase-purchaseOut-formpanel',
+
+    controller: 'purchase-purchaseOut-formcontroller',
+    viewModel: 'purchase-purchaseOut-formmodel',
+    
+    _title:'采购验退单',
+    _idField: 'id',
+    _codeField: 'pi_inoutno',
+    _statusField: 'pu_status',
+    _statusCodeField: 'pu_statuscode',
+    _detnoColumn:  'pd_pdno',
+    _relationColumn: 'pd_piid',
+    _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/',
+    initId:11,
+
+    toolBtns: [{
+        xtype: 'button',
+        text: '转单按钮',
+        handler: function() {
+            console.log('11');
+        }
+    }],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        bind: '{id}',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype : "textfield", 
+        name : "pi_inoutno", 
+        bind : "{pi_inoutno}", 
+        fieldLabel : "验退单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
+        fieldLabel : "供应商ID", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
+        fieldLabel : "供应商编号", 
+        hidden:true,
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
+        fieldLabel : "供应商名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "pd_pdno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            }, 
+            {
+                text : "验退数量", 
+                dataIndex : "pd_outqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "仓库", 
+                dataIndex : "pd_whname", 
+                width : 120.0, 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "单价", 
+                dataIndex : "pd_orderprice", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            }, 
+           {
+                text : "含税金额", 
+                dataIndex : "pd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, {
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "未税金额", 
+                dataIndex : "pd_nettotal", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "采购单号", 
+                dataIndex : "pd_ordercode", 
+                width : 120.0
+            },{
+                text : "采购序号", 
+                dataIndex : "pd_orderdetno", 
+                xtype : "numbercolumn",
+                flex:1
+            }
+        ]
+    }, {
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        readOnly : true, 
+        editable : false, 
+        name : "pi_status", 
+        bind : "{pi_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 219 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -0,0 +1,219 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'purchase-purchaseOut-querypanel',
+
+    controller: 'purchase-purchaseOut-queryformcontroller',
+    viewModel: 'purchase-purchaseOut-queryformmodel',
+    _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+    _idField:'pi_id',
+    _codeField:'pi_inoutno',
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'pi_id',
+        bind: '{pi_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'pi_inoutno',
+        bind: '{pi_inoutno}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        hidden:true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
+        fieldLabel: '供应商名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        fieldMode: 'DETAIL',
+        queryType:'VAG',
+        hidden:true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pr_detail#pd_prodcode',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['pi_statuscode', 'pi_status'],
+            data: [
+                ["$ALL", "全部"],
+                ["AUDITED", "已审核"],
+                ["UNAUDITED", "未审核"]
+            ]
+        })
+    }],
+    moreQueryFormItems: [{
+        xtype: 'textfield',
+        name: 'pu_buyername',
+        bind: '{pu_buyername}',
+        fieldLabel: '采购员',
+        allowBlank: true
+    }, {
+        xtype: 'textfield',
+        name: 'pu_total',
+        bind: '{pu_total}',
+        fieldLabel: '金额',
+        allowBlank: true
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_delivery',
+        bind: '{pu_delivery}',
+        fieldLabel: '交货日期',
+        allowBlank: true,
+        columnWidth: 1
+    }],
+    queryGridConfig: {
+        _idField:'pi_id',
+        _codeField:'pi_inoutno',
+        _title:'采购验退单',
+        _addXtype:'purchase-purchaseOut-formpanel',
+        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'pi_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pi_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '含税金额',
+            dataIndex: 'pi_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }],
+        _relativeColumn: [{
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
+        }, {
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 0,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pd_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
+            width: 120
+        },{
+            text: '采购序号',
+            dataIndex: 'pd_orderdetno',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '物料编号',
+            dataIndex: 'pd_prodcode',
+            width: 120
+        },{
+            text: '验退数量',
+            dataIndex: 'pd_outqty',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pd_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }]
+    }
+});

+ 115 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js

@@ -0,0 +1,115 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.purchase-purchaseOut-queryformcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-queryformmodel'
+});

+ 73 - 1
frontend/saas-web/app/view/test/order/FormController.js

@@ -26,6 +26,14 @@ Ext.define('saas.view.test.order.FormController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            conditionExpression:"ve_name like '{0}%'",
+                            fieldLabel : "供应商名称", 
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'ve_id',
                             "text": "供应商ID",
@@ -66,16 +74,80 @@ Ext.define('saas.view.test.order.FormController', {
             'dbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        conditionCode:'pr_code',
                         dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{
                             field:'pr_detail',width:100
                         }],
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             "text": "物料ID",
                             "flex": 0,

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

@@ -18,7 +18,7 @@ Ext.define('saas.view.test.order.FormPanel', {
     _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/',
-    initId:11,
+    initId:0,
 
     toolBtns: [{
         xtype: 'button',
@@ -149,7 +149,7 @@ Ext.define('saas.view.test.order.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }, 
                 text : "物料编号", 
                 width : 200.0,