Browse Source

merge again

guq 7 years ago
parent
commit
75d70c8fb6
27 changed files with 516 additions and 397 deletions
  1. 2 11
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java
  2. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  3. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  4. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  5. 4 7
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java
  6. 4 7
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java
  7. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  8. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  9. 10 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  10. 9 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  11. 6 5
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java
  12. 10 1
      frontend/saas-web/app/util/FormUtil.js
  13. 18 141
      frontend/saas-web/app/util/QueryUtil.js
  14. 5 4
      frontend/saas-web/app/view/core/form/FormPanel.js
  15. 17 7
      frontend/saas-web/app/view/core/form/FormPanelController.js
  16. 2 1
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  17. 32 8
      frontend/saas-web/app/view/core/form/MultiCombo.js
  18. 21 10
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  19. 4 9
      frontend/saas-web/app/view/core/query/MoreQueryFormPanel.js
  20. 51 20
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  21. 49 86
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  22. 110 0
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  23. 11 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormController.js
  24. 14 52
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  25. 110 0
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  26. 6 3
      frontend/saas-web/app/view/test/order/FormPanel.js
  27. 11 16
      frontend/saas-web/app/view/test/query/QueryPanel.js

+ 2 - 11
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java

@@ -1,15 +1,14 @@
 package com.usoftchina.saas.document.dto;
 
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 
 @ApiModel(value = "Vendor", description = "供应商资料")
-public class VendorDTO implements Serializable{
+public class VendorDTO extends CommonBaseDTO implements Serializable{
 
-    @ApiModelProperty(value = "ID")
-    private long ve_id;
     @ApiModelProperty(value = "供应商编号")
     private String ve_code;
     @ApiModelProperty(value = "供应商名称")
@@ -19,14 +18,6 @@ public class VendorDTO implements Serializable{
     @ApiModelProperty(value = "状态")
     private String ve_status;
 
-    public long getVe_id() {
-        return ve_id;
-    }
-
-    public void setVe_id(long ve_id) {
-        this.ve_id = ve_id;
-    }
-
     public String getVe_code() {
         return ve_code;
     }

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
 
@@ -23,7 +24,7 @@ public class ProductController {
 
     @RequestMapping("/getProductsByCondition")
     public Result<List<ProductDTO>> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO){
-        List<ProductDTO> productList = productService.getProductsByCondition(page, docReqDTO);
+        PageInfo<ProductDTO> productList = productService.getProductsByCondition(page, docReqDTO);
         return Result.success(productList);
     }
 

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
 import com.usoftchina.saas.commons.dto.DocReqDTO;
@@ -22,7 +23,7 @@ public class VendorController {
 
     @RequestMapping("/getVendorsByCondition")
     public Result<List<VendorDTO>> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO){
-        List<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, docReqDTO);
+        PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, docReqDTO);
         return Result.success(vendorList);
     }
 }

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

@@ -4,13 +4,14 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 
 import java.util.List;
 
 public interface ProductMapper extends CommonBaseMapper<Product> {
 
-    List<Product> getProductsByCondition(DocReqDTO docReqDTO);
+    List<ProductDTO> getProductsByCondition(DocReqDTO docReqDTO);
     List<ComboDTO> getProdUnit();
     void updateLatestPurchasePrice(Long pu_id);
 

+ 4 - 7
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java

@@ -12,7 +12,6 @@ import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -25,7 +24,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private ProductMapper productMapper;
 
     @Override
-    public List<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+    public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -33,12 +32,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Product> productList = productMapper.getProductsByCondition(docReqDTO);
-        //Product To ProductDTO
-        List<ProductDTO> productDTOList = BeanMapper.mapList(productList, ProductDTO.class);
+        List<ProductDTO> productList = productMapper.getProductsByCondition(docReqDTO);
         //取分页信息
-        PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productDTOList);
-        return productDTOList;
+        PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productList);
+        return pageInfo;
     }
 
     @Override

+ 4 - 7
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java

@@ -11,7 +11,6 @@ import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,7 +28,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
 
 
     @Override
-    public List<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+    public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO) {
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -37,11 +36,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Vendor> vendorList = vendorMapper.getVendorsByCondition(docReqDTO);
-        //Vendor To VendorDTO
-        List<VendorDTO> vendorDTOList = BeanMapper.mapList(vendorList, VendorDTO.class);
+        List<VendorDTO> vendorList = vendorMapper.getVendorsByCondition(docReqDTO);
         //取分页信息
-        PageInfo<VendorDTO> pageInfo = new PageInfo<VendorDTO>(vendorDTOList);
-        return vendorDTOList;
+        PageInfo<VendorDTO> pageInfo = new PageInfo<VendorDTO>(vendorList);
+        return pageInfo;
     }
 }

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
 
@@ -16,7 +17,7 @@ import java.util.List;
 public interface ProductService extends CommonBaseService<ProductMapper, Product> {
 
 
-    List<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
+    PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
 
     List<ComboDTO> getProdUnit();
 

+ 2 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
 
@@ -10,10 +11,9 @@ import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.page.PageRequest;
 
-import java.util.List;
 
 public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
 
-    List<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO);
+    PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO);
 
 }

+ 10 - 1
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -35,8 +35,17 @@
         <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
         <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR" />
     </resultMap>
+    <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
+        <id column="pr_id" property="id" jdbcType="INTEGER" />
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
+        <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+    </resultMap>
     <!--查询所有物料信息-->
-    <select id="getProductsByCondition" resultMap="ProductResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+    <select id="getProductsByCondition" resultMap="ProductDTOResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
         SELECT * FROM PRODUCT
         <where>
             <if test="condition!=null">

+ 9 - 1
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -29,7 +29,15 @@
         <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
         <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
     </resultMap>
-    <select id="getVendorsByCondition" resultMap="VendorResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+    <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
+        <id column="ve_id" property="id" jdbcType="INTEGER" />
+        <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
+        <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
+        <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
+        <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
         SELECT * FROM VENDOR
         <where>
             <if test="condition!=null">

+ 6 - 5
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service;
 
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.document.DocumentApplication;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import org.junit.Test;
@@ -22,10 +23,10 @@ public class VendorTest {
 
     @Test
     public void testSelectAll(){
-        List<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
-        System.out.println("vendCode: " + vendorList.get(0).getVe_code());
-        System.out.println("vendName: " + vendorList.get(0).getVe_name());
-        System.out.println("vendType: " + vendorList.get(0).getVe_type());
-        System.out.println("vendBeginDate: " + vendorList.get(0).getVe_status());
+        PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
+        System.out.println("vendCode: " + vendorList.getList().get(0).getVe_code());
+        System.out.println("vendName: " + vendorList.getList().get(0).getVe_name());
+        System.out.println("vendType: " + vendorList.getList().get(0).getVe_type());
+        System.out.println("vendBeginDate: " + vendorList.getList().get(0).getVe_status());
     }
 }

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

@@ -60,9 +60,16 @@ Ext.define('saas.util.FormUtil', {
 
                         // 如果是从表为其绑定store
                         if(item.xtype == 'detailGridField') {
+                            var columns = item.columns,
+                            cnames = columns.filter(function(c) {
+                                return c.dataIndex && !c.ignore;
+                            }).map(function(c) {
+                                return c.dataIndex
+                            });
+                            formModel.set('_detailBindFields', cnames);
                             item.bind = {
                                 store: '{_detailStore}'
-                            };           
+                            };       
                             formModel.set('_detailStore', Ext.create('Ext.data.Store', {
                                 fields: item.columns ? item.columns.filter(function(c) {
                                     return !!c.dataIndex;
@@ -77,6 +84,8 @@ Ext.define('saas.util.FormUtil', {
                                 }) : [],
                                 data: []
                             }));
+
+
                         }
                     });
                 }

+ 18 - 141
frontend/saas-web/app/util/QueryUtil.js

@@ -24,7 +24,6 @@ Ext.define('saas.util.QueryUtil', {
                 me.getStoreMode(queryMoreForm);
             }
         }
-        console.log("Mode:"+Mode);
         if(Mode=="MAIN"){
             grid._Mode = Mode;
             grid.reconfigure(grid.store, grid._baseColumn);
@@ -57,13 +56,12 @@ Ext.define('saas.util.QueryUtil', {
 				} else if (f.xtype == 'condatefield' && f.value != null ){
                     if(f.value.from != null){
                         if(condition == ''){
-                            condition += " date("+f.name+") between '"+f.value.from+"' and '"+f.value.to+"' ";
+                            condition += " ( date("+f.name+") between '"+Ext.Date.format(f.value.from,"Y-m-d H:i:s")+"' and '"+Ext.Date.format(f.value.to,"Y-m-d H:i:s")+"' )";
                         } else {
-                            condition += " AND date("+f.name+") between '"+f.value.from+"' and '"+f.value.to+"' ";
+                            condition += " AND ( date("+f.name+") between '"+Ext.Date.format(f.value.from,"Y-m-d H:i:s")+"' and '"+Ext.Date.format(f.value.to,"Y-m-d H:i:s")+"' )";
                         }
                     }
                 }else if(f.xtype == 'datefield' && f.value != null && f.value != '' ){
-                    debugger;
 					var v = Ext.Date.format(new Date(f.value), 'Y-m-d');
 					if(condition == ''){
 						condition += "date("+f.name+")='"+v+"'";
@@ -72,7 +70,6 @@ Ext.define('saas.util.QueryUtil', {
 					}
 				} else if(f.xtype == 'datetimefield' && f.value != null){
                     var v = Ext.Date.format(new Date(f.value), 'Y-m-d H:i:s');
-                    debugger;
 					if(condition == ''){
 						condition += 'date('+f.name + ")= '" + v + "'";
 					} else {
@@ -85,31 +82,23 @@ Ext.define('saas.util.QueryUtil', {
 					} else {
 						condition += ' AND ' + f.name + endChar + f.value;
 					}
-				} else if(f.xtype == 'combo' && f.value != '$ALL'){
-					if(f.store.data.length > 1) {
-						if(condition == ''){
-							condition += '(';
-						} else {
-							condition += ' AND (';
-						}
-						var _a = '';
-						f.store.each(function(d, idx){
-							if(d.data.value != '$ALL') {
-								if(_a == ''){
-									_a += f.logic + "='" + d.data.value + "'";
-								} else {
-									_a += ' OR ' + f.logic + "='" + d.data.value + "'";
-								}
-							}
-						});
-						condition += _a + ')';
-					}
+				} else if(f.xtype == 'combobox' ){
+                    if(f.value != '$ALL'&& f.value!=null){
+                        if(condition == ''){
+                            condition = f.name+" = '"+f.value+"' ";
+                        } else {
+                            condition += ' AND '+f.name+" = '"+f.value+"' ";
+                        }
+                    }
 				} else if(f.xtype == 'multicombo' ){
-				    if(f.value){
+				    if(f.value && f.value.length > 0){
+                        var text = f.value.map(function(v) {
+                            return '\'' + v.value + '\'';
+                        }).join(',');
                         if(condition == ''){
-                            condition += f.name + " in (" + f.value+")";
+                            condition = f.name + " in (" + text +")";
                         } else {
-                            condition += ' AND ' +  f.name + " in (" + f.value+")";
+                            condition += ' AND ' +  f.name + " in (" + text +")";
                         }
                     }
 
@@ -170,7 +159,7 @@ Ext.define('saas.util.QueryUtil', {
                                             var nameArr = f.name.split("#");
                                             Ext.each(nameArr, function(nameItem,index) {
                                                 if(index==0){
-                                                    condition = ' AND ('+(nameItem+ " like '%" +f.value + "%'");
+                                                    condition += ' AND ('+(nameItem+ " like '%" +f.value + "%'");
                                                 }else{
                                                     condition += " or "+nameItem+ " like '%" +f.value + "%' ";
                                                 }
@@ -207,117 +196,5 @@ Ext.define('saas.util.QueryUtil', {
 			substr = substr.toLowerCase();
 		}
 		return string.indexOf(substr) > -1;
-    },
-    /**
-     * 
-     */
-    queryData: function(grid,condition){
-        // var me = this;
-        //     if(Ext.isEmpty(condition)){
-        //         condition =" 1=1 ";
-        //     }
-        //     var params = { keyword: condition,number:1,size:15 };
-        //     var dataRes = {
-        //         url :grid.listUrl,
-        //         async:false,
-        //         params:params
-        //     };
-        //     me.BaseUtil.request(dataRes)
-        //     .then(function(response) {
-        //         var res = Ext.decode(response.responseText);
-        //         if(res.success) {
-        //             var data = res.data;
-        //             console.log(data);
-        //              grid.getStore().loadData(data.list);
-        //              grid.fireEvent('afterLoadData', grid, data.list);
-        //         }
-        //     })
-        //     .catch(function(response) {
-        //         console.log(response);
-        //         // something...
-        //     });
-    },
-    onQuery: function(parentForm,queryMoreForm){
-        var me = this,
-            grid = parentForm.down('grid'),
-            queryForm = parentForm.down('form'),
-            condition = me.getFormCondition(queryForm),
-            Mode = me.getStoreMode(queryForm);
-        if(queryMoreForm){//更多查询
-            if(!Ext.isEmpty(condition)){
-                condition = " and ( "+me.getStoreMode(queryMoreForm)+" ) ";
-            }else{
-                condition = me.getStoreMode(queryMoreForm);
-            }
-            if(Mode=="MAIN"){
-                me.getStoreMode(queryMoreForm);
-            }
-        }
-        console.log("condition:"+condition);
-        condition = " 1=1 ";
-        if(Mode=="MAIN"){
-            console.log("Mode:"+Mode+",查询当前列表");
-            grid.loadPage(1);
-        }else{
-            console.log("Mode:"+Mode+",查询当前关联列表");
-            //若明细字段含明细字段注意切换数据源 grid.reconfigure(store, columns);
-            //关联viewName = 关联viewName+"-RelativeGrid"
-            grid.loadPage(1);
-        }
-
-    },
-    add10EmptyRow: function(grid) {
-        var store = grid.getStore(),
-            selectedRecord = grid.selModel.lastSelected,
-            datas = [];
-        Ext.Array.each(new Array(10), function() {
-            datas.push({});
-        })
-        store.insert(store.indexOf(selectedRecord) + 1, datas);
-    },
-    /**
-     * 获取grid被选数据
-	 * grid:原始字符串
-	 */
-    getGridSelected:function(grid){
-        var items = grid.selModel.getSelection(),
-        data = new Array();
-		Ext.each(items, function(item, index){
-			if(!Ext.isEmpty(item.data[grid._idField])&&!Ext.isEmpty(item.data[grid._codeField])){
-				var o = new Object();
-				if(grid._idField){
-					o['id'] = item.data[grid._idField];
-                }
-                if(grid._codeField){
-					o['code'] = item.data[grid._codeField];
-                }
-                o['name'] = '';
-				data.push(o);
-            }
-		});
-		return data;
-    },
-    /**
-     * 发起批量操作请求
-	 * grid:原始字符串
-	 */
-    vastRes:function(url,params){
-        console.log("params",params);
-        var me = this,
-        pp ={baseDTOs:params} ;
-        console.log("pp",pp);
-        me.BaseUtil.request({
-                url: url,
-                params: JSON.stringify(pp),
-                method: 'POST',
-            })
-            .then(function() {
-                Ext.Msg.alert('提示','操作成功');
-            })
-            .catch(function(response) {
-                console.log(response);
-                Ext.Msg.alert('提示','操作失败');
-            });
-        }
-    
+    }
 });

+ 5 - 4
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -113,12 +113,13 @@ Ext.define('saas.view.core.form.FormPanel', {
 
     /**
      * 获取form数据
+     * @param all: true:取全部数据,false:排除忽视字段
      */
-    getFormData: function(ignore) {
+    getFormData: function(all) {
         var me = this,
         viewModel = me.getViewModel(),
         allData = viewModel.getData(),
-        bindFields = allData.bindFields,
+        bindFields = allData._bindFields,
         formData = {
             main: {},
             detail: []
@@ -127,7 +128,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         for(k in allData) {
             var d = allData[k];
             // 主表数据
-            if(ignore) {
+            if(all) {
                 formData.main[k] = d;
             }else {
                 if(bindFields.indexOf(k) != -1) {
@@ -179,7 +180,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }
             }
         });
-        viewModel.set('bindFields', bindFields);
+        viewModel.set('_bindFields', bindFields);
     },
 
     initFormData: function(formData) {

+ 17 - 7
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -60,8 +60,12 @@ Ext.define('saas.view.core.form.FormPanelController', {
     },
 
     save:function(){
-        var me = this;
-        var form = this.getView();
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData(),
+        detailBindFields = modelData._detailBindFields;
+
         if(form.getForm().wasDirty==false){
             Ext.Msg.alert('提示','未修改数据,请修改后保存');
             return false;
@@ -76,15 +80,21 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var dirtyGridData = [];
         if(gridData.length>0){
             Ext.each(gridData, function(item,index){
-                if(item.dirty){
-                    if((typeof item.data.id) != "number" && item.data.id.indexOf('extMode')>-1){
-                        item.data.id = '';
+                var d = Object.assign({}, item.data),
+                dirty = item.dirty;
+                if(dirty){
+                    if((typeof d.id) != "number" && d.id.indexOf('extMode')>-1){
+                        delete d.id;
                     }
-                    dirtyGridData.push(item.data)
+                    for(k in d) {
+                        if(!Ext.Array.contains(detailBindFields, k)) {
+                            delete d[k];
+                        }
+                    }
+                    dirtyGridData.push(d);
                 }
             });
         }  
-        debugger 
         var params = {
             main:formData.main,
             items:dirtyGridData

+ 2 - 1
frontend/saas-web/app/view/core/form/FormPanelModel.js

@@ -3,7 +3,8 @@ Ext.define('saas.view.core.form.FormPanelModel', {
     alias: 'viewmodel.core-form-formpanel',
 
     data: {
-        bindFields: [], // 请求绑定字段,绑定到formfield并且未设置ignore为true
+        _bindFields: [], // 主表绑定字段,绑定到formfield并且未设置ignore为true
+        _detailBindeFields: [], // 从表绑定列
         _detailStore: null, // 从表store
     },
 });

+ 32 - 8
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -6,6 +6,7 @@ Ext.define('saas.view.core.form.MultiCombo', {
     alias: 'widget.multicombo',
     editable : false,
     matchFieldWidth: true,
+    value: [],
     cachedConfig: {
         menuAlign: 'tl-bl?',
         destroyMenu: true
@@ -28,9 +29,6 @@ Ext.define('saas.view.core.form.MultiCombo', {
        this.showMenu();
     },
     onMouseLeave:function(a,b,c){
-        console.log(a);
-        console.log(b);
-        console.log(c);
         this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
     },
     onTriggerClick:function(){
@@ -58,12 +56,16 @@ Ext.define('saas.view.core.form.MultiCombo', {
             item,
             items = me.datas,
             itemsLn = me.datas.length,
-            menuItems = [];
+            menuItems = [],
+            value = me.value;
         for (; i < itemsLn; i++) {
             item = items[i];
+            var checked = !!value.find(function(v) {
+                return v.value = iem[0];
+            });
             menuItem = new Ext.menu.CheckItem({
                 text: item[1],
-                checked: item.checked,
+                checked: checked,
                 checkValue:item[0],
                 hideOnClick: false,
                 checkHandler: this.onCheckChange,
@@ -85,16 +87,39 @@ Ext.define('saas.view.core.form.MultiCombo', {
             }
         });
         this.setValue(checkedItems);
-        this.publishState('value', checkedItems);
     },
 
     setValue: function(items) {
-        var rawV = '';
+        var me = this, rawV = '',
+        datas = me.datas,
+        menu = me.menu;
+        if(!Ext.isArray(items)) {
+            items = [items]
+        }
+        items.map(function(item, index) {
+            if(Ext.isString(item)) {
+                var data = datas.find(function(d) {
+                    return d[0] == item;
+                });
+                items[index] = {
+                    text: data[1],
+                    value: data[0]
+                }
+            }
+        })
         rawV = items.map(function(item) {
             return item.text
         }).join(',');
         this.setRawValue(rawV);
         this.value = items;
+        if(menu) {
+            Ext.Array.each(menu.items.items, function(item) {
+                item.setChecked(!!items.find(function(i) {
+                    return i.value == item.checkValue;
+                }));
+            });
+        }
+        this.publishState('value', items);
     },
 
     showMenu: function (e, menu) {
@@ -121,7 +146,6 @@ Ext.define('saas.view.core.form.MultiCombo', {
         }
     },
     hideMenu: function(b) {
-        console.log(b);
         if (this.hasVisibleMenu()) {
             var target=b.parentEvent.relatedTarget;
             if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){

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

@@ -25,18 +25,9 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     showIndex: true,
     configUrl: '',
 
-    features: [{
-        ftype : 'groupingsummary',
-        groupHeaderTpl : '{name}',
-        hideGroupedHeader : false,
-        enableGroupingMenu : false
-    }, {
-        ftype: 'summary',
-        dock: 'bottom'
-    }],
-
     initComponent: function() {
         var me = this;
+        me.setSummary();
         Ext.apply(me, {
             dockedItems: [{
                 xtype: 'toolbar',
@@ -86,6 +77,26 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         }
     },
 
+    setSummary: function() {
+        var me = this,
+        columns = me.columns,
+        features = me.features || [];
+
+        var hasSummary = !!columns.find(function(c) {
+            return c.summaryType
+        });
+
+        if(hasSummary) {
+            features.push({
+                ftype: 'summary',
+                dock: 'bottom'
+            });
+        }
+        Ext.apply(me, {
+            features: features
+        });
+    },
+
     add10EmptyRow: function() {
         var me = this,
         form = me.ownerCt,

+ 4 - 9
frontend/saas-web/app/view/core/query/MoreQueryFormPanel.js

@@ -28,7 +28,9 @@ Ext.define('saas.view.core.query.MoreQueryFormPanel', {
                 items: [{
                     xtype: 'button',
                     text: '重置',
-                    handler: me.resetQuery
+                    handler: function(btn){
+                        btn.ownerCt.ownerCt.reset();
+                    }
                 },'->',{
                     xtype: 'button',
                     text: '查询',
@@ -46,18 +48,11 @@ Ext.define('saas.view.core.query.MoreQueryFormPanel', {
         });
         me.callParent(arguments);
     },
-    resetQuery: function(btn){
-        console.log("重置窗口");
-        btn.ownerCt.ownerCt.reset();
-    },
     onQueryMore: function(btn){
-        console.log("更多查询");
         var me = this,
             queryMoreForm = me.up('core-query-queryformpanel'),
             parentForm = queryMoreForm.up('core-query-formpanel')
-            debugger;
-            console.log(parentForm);
-            parentForm.QueryUtil.onQuery(parentForm,queryMoreForm);
+            parentForm.QueryUtil.turnRelativeGrid(grid,queryForm,queryMoreForm);
     }
     
 });

+ 51 - 20
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     //工具类
     QueryUtil: Ext.create('saas.util.QueryUtil'),
     GridUtil: Ext.create('saas.util.GridUtil'),
-
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     //字段属性
     _baseColumn: [],
     _relativeColumn: [],
@@ -37,7 +37,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 proxy: {
                     type: 'ajax',
                     url: me._baseVastUrl+'list',
-                    //url: 'http://192.168.253.58:8800/purchase/list',
                     actionMethods: {
                         read: 'GET'
                     },
@@ -56,10 +55,9 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         if (Ext.isEmpty(condition)) {
                             condition = " 1=1 ";
                         }
-                        if(mode){
+                        if(!mode){
                             mode='MAIN';
                         }
-                        console.log("condition:" + condition);
                         Ext.apply(store.proxy.extraParams, {
                             number: op._page,
                             size: store.pageSize,
@@ -79,6 +77,9 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 }, {
                     text: '审核',
                     handler: me.onAudit
+                }, {
+                    text: '反审核',
+                    handler: me.onUnAudit
                 }, {
                     text: '打印',
                     handler: me.onPrint
@@ -102,7 +103,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         });
         me.callParent(arguments);
     },
-
     listeners: {
         itemdblClick: function (tableView, record, item, index, e, eOpts) {
             var grid = tableView.up('grid'),
@@ -122,7 +122,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             }
         }
     },
-
     getFields: function() {
         var me = this;
         return me.columns.filter(function(c) {
@@ -132,7 +131,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         });
     },
     onAddMore: function (btn) {
-        var grid = btn.ownerCt.ownerCt,
+        var grid = this.getGrid(btn),
             mainTab = Ext.getCmp('main-tab-panel'),
             id = grid.xtype + '_add';
             existingItem = mainTab.down('[id=' + id + ']');
@@ -146,12 +145,10 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         }
     },
     onAudit: function(btn){
-        var grid = btn.ownerCt.ownerCt,
-        vastUrl = grid._baseVastUrl+"batchAudit",
-        selectsd = grid.QueryUtil.getGridSelected(grid),
-        currentPage = grid.getStore().currentPage;
-        grid.QueryUtil.vastRes(vastUrl,selectsd);
-        grid.getStore().loadPage(currentPage);
+        btn.ownerCt.ownerCt.vastOperation("batchAudit");
+    },
+    onUnAudit:function(btn){
+        btn.ownerCt.ownerCt.vastOperation("batchUnAudit");
     },
     onPrint: function () {
         console.log("打印");
@@ -160,11 +157,45 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         console.log("导出");
     },
     onDelete: function (btn) {
-        var grid = btn.ownerCt.ownerCt,
-        vastUrl = grid._baseVastUrl+"batchDelete",
-        selectsd = grid.QueryUtil.getGridSelected(grid),
-        currentPage = grid.getStore().currentPage;;
-        grid.QueryUtil.vastRes(vastUrl,selectsd);
-        grid.getStore().loadPage(currentPage);
-    }
+        btn.ownerCt.ownerCt.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);
+    },
+    /**
+     * 获取grid被选数据
+	 * grid:原始字符串
+	 */
+    getGridSelected:function(){
+        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];
+                }
+				data.push(o);
+            }
+		});
+		return {baseDTOs:data};
+    } 
 });

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

@@ -2,11 +2,12 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     extend: 'saas.view.core.query.QueryPanel',
     xtype: 'purchase-purchase-querypanel',
 
+    controller: 'purchase-purchase-querypanel',
     viewModel: 'purchase-purchase-querypanel',
     viewName: 'purchase-purchase-formpanel',
-    _baseVastUrl:'http://192.168.253.58:8800/purchase/',
-    _idField:'pu_id',
-    _codeField:'pu_code',
+    _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
+    _idField: 'pu_id',
+    _codeField: 'pu_code',
     queryFormItems: [{
         xtype: 'hidden',
         name: 'pu_id',
@@ -15,48 +16,12 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         allowBlank: true,
         columnWidth: 0
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pu_code',
         bind: '{pu_code}',
         fieldLabel: '单据编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
-        dbfinds:[{
-            from:'ve_code',to:'pu_code'
-        }],
-        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
-        }]
+        columnWidth: 0.25
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
@@ -70,9 +35,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         bind: '{pu_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
         name: 'pu_vendname',
@@ -83,14 +46,13 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'dbfindtrigger',
         name: 'pd_prodcode#pd_prodcode',
+        //#pr_detail
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
-        queryType:'VAG',
+        queryType: 'VAG',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
         name: 'pr_detail',
@@ -100,34 +62,35 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'combobox',
-        name: 'pr_statuscode',
-       // bind: '{pr_statuscode}',
+        name: 'pu_statuscode',
+       // bind: '{pu_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-            displayField: 'pr_status',
-            valueField: 'pr_statuscode',
-            store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pr_statuscode', 'pr_status'],
-            data: [
-                ["$ALL", "全部"],
-                ["AUDITED", "已审核"],
-                ["UNAUDITED", "未审核"]
-            ]
+        displayField: 'pu_status',
+        valueField: 'pu_statuscode',
+        editable:false,
+        store: Ext.create('Ext.data.ArrayStore', {
+        fields: ['pu_statuscode', 'pu_status'],
+        data: [
+            ["$ALL", "全部"],
+            ["AUDITED", "已审核"],
+            ["UNAUDITED", "未审核"]
+        ]
         })
     }, {
         xtype: 'multicombo',
         name: 'pu_acceptstatuscode',
-       // bind: '{pu_acceptstatuscode}',
+        bind: '{pu_acceptstatuscode}',
         fieldLabel: '入库状态',
         allowBlank: true,
         columnWidth: 0.25,
         datas: [
-                ["TURNOUT", "已入库"],
-                ["NOOUT", "未入库"],
-                ["PARTOUT", "部分入库"]
-            ]
+            ["TURNIN", "已入库"],
+            ["NOIN", "未入库"],
+            ["PARTIN", "部分入库"]
+        ]
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',
@@ -150,11 +113,11 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField:'pu_id',
-        _codeField:'pu_code',
-        _title:'采购单',
-        _addXtype:'test-order-formpanel',
-        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _idField: 'pu_id',
+        _codeField: 'pu_code',
+        _title: '采购单',
+        _addXtype: 'test-order-formpanel',
+        _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{
             text: '序号',
             width: 80,
@@ -175,21 +138,21 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '下单日期',
             dataIndex: 'pu_indate',
-            xtype:'datecolumn',
+            xtype: 'datecolumn',
             width: 200
-        },{
+        }, {
             text: '供应商名称',
             dataIndex: 'pu_vendname',
             width: 120
-        },{
+        }, {
             text: '含税金额',
             dataIndex: 'pu_taxtotal',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '金额',
             dataIndex: 'pu_total',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120,
             flex: 1
         }],
@@ -213,35 +176,35 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '下单日期',
             dataIndex: 'pu_indate',
-            xtype:'datecolumn',
+            xtype: 'datecolumn',
             width: 200
-        },{
+        }, {
             text: '供应商名称',
             dataIndex: 'pu_vendname',
             width: 120
-        },{
+        }, {
             text: '采购序号',
             dataIndex: 'pd_detno',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '物料编号',
             dataIndex: 'pd_prodcode',
             width: 120
-        },{
+        }, {
             text: '数量',
             dataIndex: 'pd_qty',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '单价',
             dataIndex: 'pd_price',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '已转数',
             dataIndex: 'pd_ytqy',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120,
             flex: 1
         }]

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

@@ -1,5 +1,115 @@
 Ext.define('saas.view.purchase.purchase.QueryPanelController', {
     extend: 'saas.view.core.query.QueryPanelController',
     alias: 'controller.purchase-purchase-querypanel',
+    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_detail',to:'pr_detail'
+                        }],
+                        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
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
 });

+ 11 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -68,12 +68,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                         conditionCode:'pr_code',
                         dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
                         dbfinds:[{
-                            from:'pr_code',to:'pd_prodcode'
+                            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",
@@ -102,6 +105,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                             "width": 200,
                             "xtype": "",
                             "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
                         }]
                     }) ;   
 

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

@@ -15,48 +15,12 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         allowBlank: true,
         columnWidth: 0
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pi_inoutno',
         bind: '{pi_inoutno}',
         fieldLabel: '单据编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
-        dbfinds:[{
-            from:'ve_code',to:'pu_code'
-        }],
-        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
-        }]
+        columnWidth: 0.25
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
@@ -65,14 +29,13 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         allowBlank: true,
         columnWidth: 0.5
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pu_vendcode',
         bind: '{pu_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        hidden:true,
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
         name: 'pu_vendname',
@@ -87,12 +50,11 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
         queryType:'VAG',
+        hidden:true,
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
@@ -106,8 +68,8 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-            displayField: 'pr_status',
-            valueField: 'pr_statuscode',
+        displayField: 'pr_status',
+        valueField: 'pr_statuscode',
         store: Ext.create('Ext.data.ArrayStore', {
             fields: ['pr_statuscode', 'pr_status'],
             data: [
@@ -128,7 +90,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         valueField: 'pu_acceptstatuscode',
         store: Ext.create('Ext.data.ArrayStore', {
             fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            data: [
+            datas: [
                 ["$ALL", "全部"],
                 ["TURNOUT", "已入库"],
                 ["NOOUT", "未入库"],
@@ -157,9 +119,9 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField:'pu_id',
-        _codeField:'pu_code',
-        _title:'采购单',
+        _idField:'pi_id',
+        _codeField:'pi_inoutno',
+        _title:'采购验收单',
         _addXtype:'test-order-formpanel',
         _baseVastUrl:'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{

+ 110 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js

@@ -1,5 +1,115 @@
 Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
     extend: 'saas.view.core.query.QueryPanelController',
     alias: 'controller.purchase-purchaseIn-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
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
 });

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

@@ -128,11 +128,14 @@ Ext.define('saas.view.test.order.FormPanel', {
             {
                 text : "序号", 
                 dataIndex : "pd_detno", 
-                width : 80.0, 
+                width : 100, 
                 xtype : "numbercolumn",
-                summaryType: 'count',
                 align : 'center',
                 format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, 
             {
                 editor : {
@@ -158,7 +161,7 @@ Ext.define('saas.view.test.order.FormPanel', {
                 text : "单位", 
                 editor : {
                     xtype : "textfield"
-                }, 
+                },
                 dataIndex : "pd_unit", 
                 width : 120.0, 
                 xtype : "", 

+ 11 - 16
frontend/saas-web/app/view/test/query/QueryPanel.js

@@ -2,8 +2,9 @@ Ext.define('saas.view.test.query.QueryPanel', {
     extend: 'saas.view.core.query.QueryPanel',
     xtype: 'test-query-querypanel',
 
-    // controller: 'test-query-formcontroller',
+    controller: 'test-query-querypanel',
     viewModel: 'test-query-querypanel',
+    
     viewName: 'test-query-formpanel',
     _baseVastUrl:'http://192.168.253.58:8800/purchase/',
     _idField:'pu_id',
@@ -113,29 +114,23 @@ Ext.define('saas.view.test.query.QueryPanel', {
             fields: ['pr_statuscode', 'pr_status'],
             data: [
                 ["$ALL", "全部"],
-                ["=AUDITED", "已审核"],
-                ["<>AUDITED", "未审核"]
+                ["AUDITED", "已审核"],
+                ["AUDITED", "未审核"]
             ]
         })
     }, {
-        xtype: 'combobox',
+        xtype: 'multicombo',
         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.Store', {
-            fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            data: [
-                ["$ALL", "全部"],
-                ["=TURNOUT", "已入库"],
-                ["=NULL", "未入库"],
-                ["=PARTOUT", "部分入库"]
-            ]
-        })
+        datas: [
+            ["$ALL", "全部"],
+            ["TURNOUT", "已入库"],
+            ["NOOUT", "未入库"],
+            ["PARTOUT", "部分入库"]
+        ]
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',