Browse Source

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

hy 7 years ago
parent
commit
049181a8f2
42 changed files with 2459 additions and 2052 deletions
  1. 82 28
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  2. 34 9
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  3. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  4. 57 0
      frontend/saas-web/app/model/purchase/ProdInDetail.js
  5. 57 0
      frontend/saas-web/app/model/purchase/ProdOutDetail.js
  6. 0 41
      frontend/saas-web/app/model/purchase/prodIODetail.js
  7. 41 24
      frontend/saas-web/app/model/purchase/purchasedetail.js
  8. 0 42
      frontend/saas-web/app/model/sale/ProdIODetail.js
  9. 51 0
      frontend/saas-web/app/model/sale/SaleInDetail.js
  10. 50 0
      frontend/saas-web/app/model/sale/SaleOutDetail.js
  11. 38 13
      frontend/saas-web/app/model/sale/Saledetail.js
  12. 0 4
      frontend/saas-web/app/view/core/dbfind/types/BomDbfindTrigger.js
  13. 1 1
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  14. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.scss
  15. 9 7
      frontend/saas-web/app/view/core/report/ReportPanel.js
  16. 10 0
      frontend/saas-web/app/view/document/bom/BasePanel.js
  17. 2 0
      frontend/saas-web/app/view/document/bom/FormController.js
  18. 10 4
      frontend/saas-web/app/view/document/bom/FormPanel.js
  19. 1 1
      frontend/saas-web/app/view/home/charts/MonthIO.js
  20. 1 1
      frontend/saas-web/app/view/home/charts/ProfitDetail.js
  21. 1 1
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  22. 1 1
      frontend/saas-web/app/view/home/charts/StockAmount.js
  23. 0 1
      frontend/saas-web/app/view/home/infoCardList/InfoList.scss
  24. 378 388
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  25. 63 33
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  26. 372 378
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  27. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  28. 365 335
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  29. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  30. 368 359
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  31. 1 1
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  32. 81 45
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  33. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  34. 355 324
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  35. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  36. 1 1
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  37. 6 0
      frontend/saas-web/app/view/stock/make/FormPanel.js
  38. 3 0
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  39. 8 0
      frontend/saas-web/app/view/stock/make/QueryPanel.js
  40. 1 1
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  41. 3 3
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  42. 1 1
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

+ 82 - 28
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java

@@ -149,6 +149,10 @@ public class ExcelServiceImpl implements ExcelService{
             StringBuilder err = new StringBuilder();
             JSONArray mains = new JSONArray();
             JSONArray details = new JSONArray();
+            //联系人
+            JSONObject contact = new JSONObject();
+            //地址
+            JSONObject address = new JSONObject();
             //数据行循环
             for (int i = 0; i < datas.size(); i++) {
                 Map<String,String> data = datas.get(i);
@@ -157,13 +161,13 @@ public class ExcelServiceImpl implements ExcelService{
                 String value = null;
                 JSONObject mainData = null;
                 JSONObject detailData = null;
+                //标识是否一个主表的数据
+                boolean difference = true;
                 dd.setCompanyid(companyId);
                 dd.setDd_diid(keyvalue);
                 //主从表循环
                 for (int j = 0; j < positions.size(); j++) {
                    String position = positions.get(j);
-                    //标识是否一个主表的数据
-                   boolean difference = true;
                     //依据主从表分类
                    if ("main".equals(position)) {
                        List<TempletSet> main = columns.get(position);
@@ -224,40 +228,90 @@ public class ExcelServiceImpl implements ExcelService{
                        //从表字段
                        List<TempletSet> detail = columns.get(position);
                        detailData = new JSONObject();
-                       for (TempletSet set : detail) {
-                           //取excel值
-                           value = data.get(set.getDescription());
-                           if ("true".equals(set.getNecessary()) && StringUtils.isEmpty(value)) {
-                               detailData = null;
-                               //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
-                               break;
+                       //客户资料导入特殊处理
+                       if ("Customer".equals(caller)) {
+                           if (!difference) {
+                               throw new BizException(987654, "第" + (i + 3) + "行 " + "客户资料导入时,从表最多存在一条记录");
                            }
-                           //检测日期类型是否规范
-                           if ("date".equals(set.getType()) && !StringUtils.isEmpty(value)) {
-                               value = praseDate(value);
-                               if (null == value) {
-                                   err.append("第" + (i + 3) + "行 " + set.getDescription() + " 日期格式不正确!<br/> ");
+                           for (TempletSet set : detail) {
+                               //取excel值
+                               value = data.get(set.getDescription());
+                               if ("true".equals(set.getNecessary()) && StringUtils.isEmpty(value)) {
+                                   err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                    break;
                                }
+                               //检测日期类型是否规范
+                               if ("date".equals(set.getType()) && !StringUtils.isEmpty(value)) {
+                                   value = praseDate(value);
+                                   if (null == value) {
+                                       err.append("第" + (i + 3) + "行 " + set.getDescription() + " 日期格式不正确!<br/> ");
+                                       break;
+                                   }
+                               }
+                               //如果为数字类型且为空默认赋值0,检测是否为数字类型
+                               if ("number".equals(set.getType())) {
+                                   if (StringUtils.isEmpty(value)) {
+                                       value = "0";
+                                   } else {
+                                       Boolean numner = isNumner(value);
+                                       if (!numner) {
+                                           err.append("第" + (i + 3) + "行 " + set.getDescription() + " 数字格式不正确!<br/> ");
+                                           break;
+                                       }
+                                   }
+                               }
+                               if (StringUtils.hasText(value) && !"0".equals(value)) {
+                                   if ("contact".equals(set.getPosition())) {
+                                       contact.put(set.getField(), value);
+                                   } else {
+                                       address.put(set.getField(), value);
+                                   }
+                               }
                            }
-                           //如果为数字类型且为空默认赋值0,检测是否为数字类型
-                           if ("number".equals(set.getType())) {
-                               if (StringUtils.isEmpty(value)) {
-                                   value = "0";
-                               } else {
-                                   Boolean numner = isNumner(value);
-                                   if (!numner) {
-                                       err.append("第" + (i + 3) + "行 " + set.getDescription() + " 数字格式不正确!<br/> ");
+                           if (contact.size() > 0 && address.size() > 0) {
+                               dd.setDd_codevalue(codeValue);
+                               detailData.put("contact", contact);
+                               detailData.put("address", address);
+                               dd.setDd_detaildata(detailData.toJSONString());
+                           }
+                       } else {
+                           for (TempletSet set : detail) {
+                               //取excel值
+                               value = data.get(set.getDescription());
+                               if ("true".equals(set.getNecessary()) && StringUtils.isEmpty(value)) {
+                                   detailData = null;
+                                   //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
+                                   break;
+                               }
+                               //检测日期类型是否规范
+                               if ("date".equals(set.getType()) && !StringUtils.isEmpty(value)) {
+                                   value = praseDate(value);
+                                   if (null == value) {
+                                       err.append("第" + (i + 3) + "行 " + set.getDescription() + " 日期格式不正确!<br/> ");
                                        break;
                                    }
                                }
+                               //如果为数字类型且为空默认赋值0,检测是否为数字类型
+                               if ("number".equals(set.getType())) {
+                                   if (StringUtils.isEmpty(value)) {
+                                       value = "0";
+                                   } else {
+                                       Boolean numner = isNumner(value);
+                                       if (!numner) {
+                                           err.append("第" + (i + 3) + "行 " + set.getDescription() + " 数字格式不正确!<br/> ");
+                                           break;
+                                       }
+                                   }
+                               }
+                               //拼从表数据
+                               if (StringUtils.hasText(value) && !"0".equals(value)) {
+                                   detailData.put(set.getField(), value);
+                               }
+                           }
+                           if (null != detailData && detailData.size() > 0) {
+                               dd.setDd_codevalue(codeValue);
+                               dd.setDd_detaildata(detailData.toJSONString());
                            }
-                           //拼从表数据
-                           detailData.put(set.getField(), value);
-                       }
-                       if (null != detailData && detailData.size() > 0) {
-                           dd.setDd_codevalue(codeValue);
-                           dd.setDd_detaildata(detailData.toJSONString());
                        }
                    }
                 }

+ 34 - 9
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -516,7 +516,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             Integer detno = null;
             for (String code : datas.keySet()) {
                 listDTO = new CustomerFormDTO();
-                List<CustomercontactDTO> details_ = new ArrayList<>();
+                List<CustomercontactDTO> details_1 = new ArrayList<>();
+                List<CustomeraddressDTO> details_2 = new ArrayList<>();
                 int i = getMapper().validateCodeWhenInsert(code, companyId);
                 List<DataImportDetail> data = datas.get(code);
                 DataImportDetail main = dataImportMapper.selectMainBycode(code, id, companyId);
@@ -552,18 +553,33 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 if (data.size() > 0) {
                     detno = 1;
                     for (DataImportDetail vendorDetail : data) {
-                        CustomercontactDTO detail = JSONObject.parseObject(vendorDetail.getDd_detaildata(), CustomercontactDTO.class);
-                        if (null != detail) {
-                            detail.setCc_cuid(customerDTO.getId());
-                            detail.setCc_detno(detno);
-                            detno++;
-                            details_.add(detail);
+                        JSONObject obj = (JSONObject)JSONObject.parse(vendorDetail.getDd_detaildata());
+                        if ( null != obj.get("contact")) {
+                            parseDefault((JSONObject) obj.get("contact"), "cc_default");
                         }
+                        //客户联系人
+                        CustomercontactDTO contact = JSONObject.parseObject(String.valueOf(obj.get("contact")), CustomercontactDTO.class);
+                        if (null != contact) {
+                            contact.setCc_cuid(customerDTO.getId());
+                            contact.setCc_detno(detno);
+                            details_1.add(contact);
+                        }
+                        if ( null != obj.get("address")) {
+                            parseDefault((JSONObject) obj.get("address"), "ca_default");
+                        }
+                        //送货地址
+                        CustomeraddressDTO address = JSONObject.parseObject(String.valueOf(obj.get("address")), CustomeraddressDTO.class);
+                        if (null != address) {
+                            address.setCa_cuid(customerDTO.getId());
+                            address.setCa_detno(detno);
+                            details_2.add(address);
+                        }
+                        detno++;
                     }
                 }
                 listDTO.setMain(customerDTO);
-                listDTO.setItems1(details_);
-                listDTO.setItems2(new ArrayList<CustomeraddressDTO>());
+                listDTO.setItems1(details_1);
+                listDTO.setItems2(details_2);
                 list.add(listDTO);
             }
             if (err.length() > 0) {
@@ -577,6 +593,15 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         }
     }
 
+    private void parseDefault(JSONObject obj, String field) {
+        Object def = obj.get(field);
+       if ("是".equals(def)) {
+           obj.put(field, 1);
+       }else {
+           obj.put(field, 0);
+       }
+
+    }
 
     private List<CustomerList> getListByMode(ListReqDTO req) {
         List<CustomerList> list = null;

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

@@ -132,6 +132,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchase.setPu_code(pu_code);
         //判断更新与保存动作
         if (StringUtils.isEmpty(pu_id) || "0".equals(pu_id.toString())) {
+            purchase.setPu_acceptstatus(Status.UNTURNIN.getDisplay());
+            purchase.setPu_acceptstatuscode(Status.UNTURNIN.name());
             purchase.setCompanyId(companyId);
             //插入操作
             purchaseMapper.insertSelective(purchase);

+ 57 - 0
frontend/saas-web/app/model/purchase/ProdInDetail.js

@@ -0,0 +1,57 @@
+Ext.define('saas.model.purchase.ProdInDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_inqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float'}, // 单价
+        { name: 'pd_orderprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * rec.get('pd_inqty');
+            },
+            depends: ['pd_netprice', 'pd_inqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                return rec.get('pd_orderprice') * rec.get('pd_inqty');
+            },
+            depends: ['pd_orderprice', 'pd_inqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'string' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_orderid', type: 'int' }, // 采购单明细id
+        { name: 'pd_ordercode', type: 'string' }, // 采购单号
+        { name: 'pd_orderdetno', type: 'int' }, // 采购序号
+        { name: 'pd_remark', type: 'string' }, // 备注
+
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
+});

+ 57 - 0
frontend/saas-web/app/model/purchase/ProdOutDetail.js

@@ -0,0 +1,57 @@
+Ext.define('saas.model.purchase.ProdOutDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_outqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_orderprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * rec.get('pd_outqty');
+            },
+            depends: ['pd_netprice', 'pd_outqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                return rec.get('pd_orderprice') * rec.get('pd_outqty');
+            },
+            depends: ['pd_orderprice', 'pd_outqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'string' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_ioid', type: 'int' }, // 验收明细id
+        { name: 'iocode', type: 'string' }, // 验收单号
+        { name: 'iodetno', type: 'int' }, // 验收序号
+        { name: 'pd_remark', type: 'string' }, // 备注
+
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
+});

+ 0 - 41
frontend/saas-web/app/model/purchase/prodIODetail.js

@@ -1,41 +0,0 @@
-Ext.define('saas.model.purchase.ProdIODetail', {
-    extend: 'saas.model.Base',
-
-    fields: [
-
-        { name: 'id', type: 'int' },
-        { name: 'pd_piid', type: 'int' },
-        { name: 'pd_inoutno', type: 'string' },
-        { name: 'pd_piclass', type: 'string' },
-        { name: 'pd_pdno', type: 'int' },
-        { name: 'pd_ordercode', type: 'string' },
-        { name: 'pd_orderdetno', type: 'int' },
-        { name: 'pd_prodid', type: 'int' },
-        { name: 'pd_prodcode', type: 'string' },
-        { name: 'pd_unit', type: 'string' },
-        { name: 'pd_inqty', type: 'float' },
-        { name: 'pd_outqty', type: 'float' },
-        { name: 'pd_orderprice', type: 'float' },
-        { name: 'pd_sendprice', type: 'float' },
-        { name: 'pd_price', type: 'float' },
-        { name: 'pd_total', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_netprice', type: 'float' },
-        { name: 'pd_nettotal', type: 'float' },
-        { name: 'pd_whid', type: 'int' },
-        { name: 'pd_whcode', type: 'string' },
-        { name: 'pd_whname', type: 'string' },
-        { name: 'pd_inwhid', type: 'int' },
-        { name: 'pd_inwhcode', type: 'string' },
-        { name: 'pd_inwhname', type: 'string' },
-        { name: 'pd_orderid', type: 'int' },
-        { name: 'pd_sdid', type: 'int' },
-        { name: 'pd_status', type: 'string' },
-        { name: 'pd_ym', type: 'int' },
-        { name: 'pd_yqty', type: 'int' },
-        { name: 'pd_remark', type: 'string' },
-        { name: 'pd_ioid', type: 'int' }
-    ],
-    //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
-});

+ 41 - 24
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -2,30 +2,47 @@ Ext.define('saas.model.purchase.Purchasedetail', {
     extend: 'saas.model.Base',
 
     fields: [
-        { name: 'id', type: 'int' },
-        { name: 'pd_id', type: 'int' },
-        { name: 'pd_puid', type: 'int' },
-        { name: 'pd_code', type: 'string' },
-        { name: 'pd_detno', type: 'int' },
-        { name: 'pd_prodid', type: 'int' },
-        { name: 'pd_prodcode', type: 'string' },
-        { name: 'pd_unit', type: 'string' },
-        { name: 'pd_qty', type: 'float' },
-        { name: 'pd_yqty', type: 'float' },
-        { name: 'pd_price', type: 'float' },
-        { name: 'pd_taxprice', type: 'float' },
-        { name: 'pd_total', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_taxtotal', type: 'float' },
-        { name: 'pd_acceptqty', type: 'float' },
-        { name: 'pd_delivery', type: 'date' },
-        { name: 'pd_salecode', type: 'string' },
-        { name: 'pd_saledetno', type: 'int' },
-        { name: 'pd_sdid', type: 'int' },
-        { name: 'pd_remark', type: 'string' },
-        { name: 'companyid', type: 'int' },
-        { name: 'updaterId', type: 'int' },
-        { name: 'updatedate', type: 'date' },
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_qty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_taxprice', type: 'float', // 单价
+        },
+        { name: 'pd_price', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('pd_taxprice') * (1 + rec.get('pd_taxrate') / 100);
+            },
+            depends: ['pd_taxprice', 'pd_taxrate']
+        },
+        { name: 'pd_taxtotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('pd_taxprice') * rec.get('pd_qty');
+            },
+            depends: ['pd_taxprice', 'pd_qty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('pd_total') - rec.get('pd_taxtotal');
+            },
+            depends: ['pd_total', 'pd_taxtotal']
+        },
+        { name: 'pd_total', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                return rec.get('pd_price') * rec.get('pd_qty');
+            },
+            depends: ['pd_price', 'pd_qty']
+        },
+        { name: 'pd_delivery', type: 'date' }, // 需求日期
+        { name: 'pr_zxbzs', type: 'float' }, // 最小包装数
+        { name: 'pd_salecode', type: 'string' }, // 关联销售单号
+        { name: 'pd_remark', type: 'string' }, // 备注
+
         { name: 'pd_text1', type: 'string' },
         { name: 'pd_text2', type: 'string' },
         { name: 'pd_text3', type: 'string' },

+ 0 - 42
frontend/saas-web/app/model/sale/ProdIODetail.js

@@ -1,42 +0,0 @@
-Ext.define('saas.model.sale.ProdIODetail', {
-    extend: 'saas.model.Base',
-
-    fields: [
-
-        { name: 'id', type: 'int' },
-        { name: 'pd_piid', type: 'int' },
-        { name: 'pd_inoutno', type: 'string' },
-        { name: 'pd_piclass', type: 'string' },
-        { name: 'pd_pdno', type: 'int' },
-        { name: 'pd_ordercode', type: 'string' },
-        { name: 'pd_orderdetno', type: 'int' },
-        { name: 'pd_prodid', type: 'int' },
-        { name: 'pd_prodcode', type: 'string' },
-        { name: 'pd_unit', type: 'string' },
-        { name: 'pd_inqty', type: 'float' },
-        { name: 'pd_outqty', type: 'float' },
-        { name: 'pd_orderprice', type: 'float' },
-        { name: 'pd_sendprice', type: 'float' },
-        { name: 'pd_price', type: 'float' },
-        { name: 'pd_total', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_netprice', type: 'float' },
-        { name: 'pd_nettotal', type: 'float' },
-        { name: 'pd_whid', type: 'int' },
-        { name: 'pd_whcode', type: 'string' },
-        { name: 'pd_whname', type: 'string' },
-        { name: 'pd_inwhid', type: 'int' },
-        { name: 'pd_inwhcode', type: 'string' },
-        { name: 'pd_inwhname', type: 'string' },
-        { name: 'pd_orderid', type: 'int' },
-        { name: 'pd_sdid', type: 'int' },
-        { name: 'pd_status', type: 'string' },
-        { name: 'pd_ym', type: 'int' },
-        { name: 'pd_yqty', type: 'int' },
-        { name: 'pd_remark', type: 'string' },
-        { name: 'pd_ioid', type: 'int' },
-        { name: 'pd_ordertotal', type: 'float' }
-    ],
-    //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
-});

+ 51 - 0
frontend/saas-web/app/model/sale/SaleInDetail.js

@@ -0,0 +1,51 @@
+Ext.define('saas.model.sale.SaleInDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'id', type: 'int' }, // id
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_inqty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'float' }, // 单位
+        { name: 'pd_netprice', type: 'float', // 单价
+        },
+        { name: 'pd_sendprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * rec.get('pd_inqty');
+            },
+            depends: ['pd_netprice', 'pd_inqty']
+        },
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float',// 价税合计
+            convert: function(v, rec) {
+                return rec.get('pd_sendprice') * rec.get('pd_inqty');
+            },
+            depends: ['pd_sendprice', 'pd_inqty']
+        },
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'string' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_sdid', type: 'int' }, // 销售订单明细id
+        { name: 'pd_ordercode', type: 'int' }, // 销售单号
+        { name: 'pd_orderdetno', type: 'int' }, // 销售序号
+        { name: 'pd_remark', type: 'string' }, // 备注
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
+});

+ 50 - 0
frontend/saas-web/app/model/sale/SaleOutDetail.js

@@ -0,0 +1,50 @@
+Ext.define('saas.model.sale.SaleOutDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+
+        { name: 'id', type: 'int' },
+        { name: 'pd_prodid', type: 'int' }, // 物料id
+        { name: 'pd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_outqty', type: 'int' }, // 出货数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_whid', type: 'int' }, // 仓库id
+        { name: 'pd_whcode', type: 'float' }, // 仓库编号
+        { name: 'pd_whname', type: 'string' }, // 仓库
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_sendprice', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
+            },
+            depends: ['pd_netprice', 'pd_taxrate']
+        },
+        { name: 'pd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('pd_netprice') * rec.get('pd_outqty');
+            },
+            depends: ['pd_netprice', 'pd_outqty']
+        },
+        { name: 'pd_ordertotal', type: 'float', // 价税合计
+            convert: function(v, rec) {
+                return rec.get('pd_sendprice') * rec.get('pd_outqty');
+            },
+            depends: ['pd_sendprice', 'pd_outqty']
+        },
+        { name: 'pd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordercode', type: 'string' }, // 销售单号
+        { name: 'pd_orderdetno', type: 'string' }, // 销售序号
+        { name: 'pd_remark', type: 'string' }, // 备注
+    ],
+    //一对一映射
+    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
+});

+ 38 - 13
frontend/saas-web/app/model/sale/Saledetail.js

@@ -2,19 +2,44 @@ Ext.define('saas.model.sale.Saledetail', {
     extend: 'saas.model.Base',
 
     fields: [
-        { name: 'sd_detno', type: 'int' },
-        { name: 'id', type: 'int' },
-        { name: 'sd_prodcode', type: 'string' },
-        { name: 'sd_qty', type: 'float' },
-        { name: 'sd_yqty', type: 'float' },
-        { name: 'sd_price', type: 'float' },
-        { name: 'sd_taxrate', type: 'float' },
-        { name: 'sd_total', type: 'float' },
-        { name: 'sd_delivery', type: 'date' },
-        { name: 'sd_taxtotal', type: 'float' },
-        { name: 'sd_pucode', type: 'string' },
-        { name: 'sd_text1', type: 'string' },
-        { name: 'sd_remark', type: 'string' }
+        { name: 'id', type: 'int' }, // id
+        { name: 'sd_prodid', type: 'int' }, // 物料id
+        { name: 'sd_prodcode', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'sd_qty', type: 'float' }, // 数量
+        { name: 'pr_unit', type: 'float' }, // 单位
+        { name: 'sd_netprice', type: 'float', // 单价
+        },
+        { name: 'sd_price', type: 'float', // 含税单价
+            convert: function(v, rec) {
+                return rec.get('sd_netprice') * (1 + rec.get('sd_taxrate') / 100);
+            },
+            depends: ['sd_netprice', 'sd_taxrate']
+        },
+        { name: 'sd_nettotal', type: 'float', // 金额
+            convert: function(v, rec) {
+                return rec.get('sd_netprice') * rec.get('sd_qty');
+            },
+            depends: ['sd_netprice', 'sd_qty']
+        },
+        { name: 'sd_taxrate', type: 'float' }, // 税率
+        { name: 'sd_taxamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                return rec.get('sd_total') - rec.get('sd_nettotal');
+            },
+            depends: ['sd_total', 'sd_nettotal']
+        },
+        { name: 'sd_total', type: 'float',// 价税合计
+            convert: function(v, rec) {
+                return rec.get('sd_price') * rec.get('sd_qty');
+            },
+            depends: ['sd_price', 'sd_qty']
+        },
+        { name: 'sd_delivery', type: 'date' }, // 交货日期
+        { name: 'sd_remark', type: 'string' }, // 备注
     ],
     //一对一映射
     associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]

+ 0 - 4
frontend/saas-web/app/view/core/dbfind/types/BomDbfindTrigger.js

@@ -44,10 +44,6 @@ Ext.define('saas.view.core.dbfind.types.BomDbfindTrigger', {
         text: "产品名称",
         width: 200,
         dataIndex: "bo_mothername",
-    }, {
-        text: "产品品牌",
-        width: 150,
-        dataIndex: "pr_brand",
     }, {
         text: "产品型号",
         width: 150,

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

@@ -49,7 +49,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 clicksToEdit: 1,
                 listeners: {
                     edit: function(editor, context, eOpts) {
-                        context.column.fireEvent('edit', context.value);
+                        context.column.fireEvent('edit', context.value, me, context.column, editor, context, eOpts);
                     }
                 }
             }, {

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.scss

@@ -3,7 +3,7 @@
     .x-querygrid-code-column {
 
         .x-grid-cell-inner {
-            color: #53b0f3;
+            color: #3e80f6;
             cursor: pointer;
         }
     }

+ 9 - 7
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -188,17 +188,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
     },
 
     initStore: function () {
-        var me = this;
-        var store = Ext.create('Ext.data.Store', {
+        var me = this, cfg = {};
+        if(me.groupField) {
+            cfg.sorters = {
+                property: me.groupField,
+                direction: 'ASC'
+            }
+        }
+        var store = Ext.create('Ext.data.Store', Ext.Object.merge({
             fields: me.getFields(),
             // model: me.reportModel,
             autoLoad: me.autoLoad,
             pageSize: 15,
             data: [],
-            sorters: {
-                property: me.groupField || 'id',
-                direction: 'ASC'
-            },
             proxy: {
                 type: 'ajax',
                 url: me.listUrl,
@@ -253,7 +255,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
                 }
             }
-        });
+        }, cfg));
 
         if (me.groupField) {
             store.setGrouper({

+ 10 - 0
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -83,6 +83,16 @@ Ext.define('saas.view.document.bom.BasePanel', {
             dataIndex : "bo_mothername", 
             width :200.0, 
         }, 
+        {
+            text : "产品型号", 
+            dataIndex : "pr_orispeccode", 
+            width :150.0, 
+        }, 
+        {
+            text : "产品规格", 
+            dataIndex : "pr_spec", 
+            width :150.0, 
+        }, 
         {
             text : "产品状态", 
             dataIndex : "bo_status", 

+ 2 - 0
frontend/saas-web/app/view/document/bom/FormController.js

@@ -16,6 +16,8 @@ Ext.define('saas.view.document.bom.FormController', {
                             from:'pr_detail',to:'bo_mothername'
                         }, {
                             from:'pr_spec',to:'pr_spec'
+                        }, {
+                            from:'pr_orispeccode',to:'pr_orispeccode'
                         }, {
                             from:'id',to:'bo_motherid',ignore:true
                         }],

+ 10 - 4
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -59,6 +59,11 @@ Ext.define('saas.view.document.bom.FormPanel', {
         name: 'bo_mothercode',
         fieldLabel: '产品编号',
         allowBlank: false
+    },{
+        xtype: 'textfield',
+        name: 'pr_brand',
+        fieldLabel: '品牌',
+        readOnly:true,
     },{
         xtype: 'textfield',
         name: 'bo_mothername',
@@ -67,14 +72,15 @@ Ext.define('saas.view.document.bom.FormPanel', {
         allowBlank: false
     },{
         xtype: 'textfield',
-        name: 'pr_brand',
-        fieldLabel: '产品品牌',
+        name: 'pr_orispeccode',
+        fieldLabel: '产品型号',
         readOnly:true,
     },{
         xtype: 'textfield',
-        name: 'pr_orispeccode',
-        fieldLabel: '产品型号',
+        name: 'pr_spec',
+        fieldLabel: '产品规格',
         readOnly:true,
+        ignore:true
     },{
         xtype: 'textfield',
         name: 'bo_version',

+ 1 - 1
frontend/saas-web/app/view/home/charts/MonthIO.js

@@ -76,7 +76,7 @@ Ext.define('saas.view.home.charts.MonthIO', {
             grid: {
                 left: 0,
                 right: 0,
-                bottom: 0,
+                bottom: 5,
                 top: 40,
                 borderColor: '#E5EAEF',
                 containLabel: true

+ 1 - 1
frontend/saas-web/app/view/home/charts/ProfitDetail.js

@@ -39,7 +39,7 @@ Ext.define('saas.view.home.charts.ProfitDetail', {
                 left: 0,
                 right: 0,
                 top: 10,
-                bottom: 0,
+                bottom: 5,
                 borderColor: '#E5EAEF',
                 containLabel: true
             },

+ 1 - 1
frontend/saas-web/app/view/home/charts/SaleTrend.js

@@ -89,7 +89,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
             grid: {
                 left: 0,
                 right: 16,
-                bottom: 0,
+                bottom: 5,
                 top: 40,
                 borderColor: '#E5EAEF',
                 containLabel: true

+ 1 - 1
frontend/saas-web/app/view/home/charts/StockAmount.js

@@ -60,7 +60,7 @@ Ext.define('saas.view.home.charts.StockAmount', {
             grid: {
                 left: 0,
                 right: 0,
-                bottom: 0,
+                bottom: 5,
                 top: 10,
                 borderColor: '#E5EAEF',
                 containLabel: true

+ 0 - 1
frontend/saas-web/app/view/home/infoCardList/InfoList.scss

@@ -6,7 +6,6 @@
     .x-code-column {
 
         .x-grid-cell-inner {
-            text-decoration: underline;
             color: #3E80F6;
             cursor: pointer;
         }

+ 378 - 388
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -6,447 +6,437 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     viewModel: 'purchase-purchase-formpanel',
 
     viewName: 'purchase-purchase-formpanel',
-    caller:'Purchase',
-    
-     //字段属性
-     _title:'采购订单',
-     _idField: 'id',
-     _codeField: 'pu_code',
-     _statusField: 'pu_status',
-     _statusCodeField: 'pu_statuscode',
-     _auditmanField: 'pu_auditman',
-     _auditdateField:'pu_auditdate',
-     _relationColumn: 'pd_puid',
-     _readUrl:'/api/purchase/purchase/read',
-     _saveUrl:'/api/purchase/purchase/save',
-     _auditUrl:'/api/purchase/purchase/audit',
-     _unAuditUrl: '/api/purchase/purchase/unAudit',
-     _deleteUrl:'/api/purchase/purchase/delete',
-     _turnInUrl:'/api/purchase/purchase/turnProdin',
-     initId:0,
-     initComponent:function() {
-        Ext.applyIf(this,{
+    caller: 'Purchase',
+
+    //字段属性
+    _title: '采购订单',
+    _idField: 'id',
+    _codeField: 'pu_code',
+    _statusField: 'pu_status',
+    _statusCodeField: 'pu_statuscode',
+    _auditmanField: 'pu_auditman',
+    _auditdateField: 'pu_auditdate',
+    _relationColumn: 'pd_puid',
+    _readUrl: '/api/purchase/purchase/read',
+    _saveUrl: '/api/purchase/purchase/save',
+    _auditUrl: '/api/purchase/purchase/audit',
+    _unAuditUrl: '/api/purchase/purchase/unAudit',
+    _deleteUrl: '/api/purchase/purchase/delete',
+    _turnInUrl: '/api/purchase/purchase/turnProdin',
+    initId: 0,
+    initComponent: function () {
+        Ext.applyIf(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
                 fieldLabel: 'id'
-            },{
-                xtype : "hidden", 
-                name : "pu_vendid", 
-                fieldLabel : "供应商ID"
             }, {
-                xtype : "hidden", 
-                name : "pu_vendcode", 
-                fieldLabel : "供应商编号"
+                xtype: "hidden",
+                name: "pu_vendid",
+                fieldLabel: "供应商ID"
+            }, {
+                xtype: "hidden",
+                name: "pu_vendcode",
+                fieldLabel: "供应商编号"
             }, {
-                xtype : "vendorDbfindTrigger", 
-                name : "pu_vendname", 
-                fieldLabel : "供应商名称",
-                allowBlank : false,
-            },{
-                xtype : "datefield", 
-                name : "pu_delivery", 
-                fieldLabel : "需求日期",
-                allowBlank:false,
+                xtype: "vendorDbfindTrigger",
+                name: "pu_vendname",
+                fieldLabel: "供应商名称",
+                allowBlank: false,
+            }, {
+                xtype: "datefield",
+                name: "pu_delivery",
+                fieldLabel: "需求日期",
+                allowBlank: false,
                 defaultValue: new Date(),
-                columnWidth : 0.25,
-            },{
-                name : "pu_shipaddresscode", 
-                editable:false,
-                xtype : "remotecombo", 
-                storeUrl:'/api/document/address/getCombo',
-                fieldLabel : "交货地址", 
-                allowBlank : false, 
-                columnWidth : 0.5,
-                hiddenBtn:false,//true 则会关闭新增按钮功能
-                addHandler:function(b){
+                columnWidth: 0.25,
+            }, {
+                name: "pu_shipaddresscode",
+                editable: false,
+                xtype: "remotecombo",
+                storeUrl: '/api/document/address/getCombo',
+                fieldLabel: "交货地址",
+                allowBlank: false,
+                columnWidth: 0.5,
+                hiddenBtn: false, //true 则会关闭新增按钮功能
+                addHandler: function (b) {
                     var form = this.ownerCmp.ownerCt;
                     this.dialog = form.add({
                         xtype: 'document-address-window',
                         bind: {
                             title: '新增交货地址'
                         },
-                        _parent:form,
-                        _combo:this.ownerCmp,
-                        record:null,
+                        _parent: form,
+                        _combo: this.ownerCmp,
+                        record: null,
                         session: true
                     });
                     this.dialog.show();
                 }
-            },{
-                name : "detailGridField", 
-                xtype : "detailGridField", 
-                storeModel:'saas.model.purchase.Purchasedetail',
-                detnoColumn:  'pd_detno',
-                deleteDetailUrl:'/api/purchase/purchase/deleteDetail',
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.purchase.Purchasedetail',
+                detnoColumn: 'pd_detno',
+                deleteDetailUrl: '/api/purchase/purchase/deleteDetail',
                 allowEmpty: false,
-                columns : [
-                    {
-                        text : "id", 
-                        dataIndex : "id", 
-                        xtype : "numbercolumn",
-                        hidden:true
-                    },{
-                        text : "物料id", 
-                        dataIndex : "pd_prodid", 
-                        xtype : "numbercolumn",
-                        hidden:true
-                    },
-                    {
-                        text : "物料编号", 
-                        width : 150.0, 
-                        dataIndex : "pd_prodcode", 
-                        xtype : "", 
-                        items : null,
-                        allowBlank : false,
-                        editor : {
-                            xtype : "productMultiDbfindTrigger"
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: "品牌",
+                    width: 150.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },
-                    {
-                        text : "品牌", 
-                        width : 150.0, 
-                        dataIndex : "pr_brand",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                        return v;
+                    }
+                }, {
+                    text: "名称",
+                    width: 200.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },
-                    {
-                        text : "名称", 
-                        width : 200.0, 
-                        dataIndex : "pr_detail",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },
-                    {
-                        text : "型号", 
-                        width : 200.0, 
-                        dataIndex : "pr_orispeccode",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                        return v;
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "规格",
+                    width: 150,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
+                        return v;
+                    }
+                }, {
+                    text: "数量",
+                    dataIndex: "pd_qty",
+                    xtype: 'numbercolumn',
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
                     },
-                    {
-                        text: 'model映射需要',
-                        dataIndex: 'productDTO',
-                        hidden: true,
-                    },{
-                        text : "规格", 
-                        width : 150, 
-                        dataIndex : "pr_spec",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },{
-                        text : "数量", 
-                        dataIndex : "pd_qty", 
-                        xtype: 'numbercolumn',
-                        width : 110.0,
-                        allowBlank : false,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 3,
-                            minValue:0
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        }
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                        var format = '0.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
                     },
-                    {
-                        text : "单位", 
-                        width : 80.0, 
-                        dataIndex : "pr_unit",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                        var format = '0.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "单位",
+                    width: 80.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxprice",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
                     },
-                    {
-                        text : "单价(元)", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "pd_price", 
-                        width : 110.0,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 4,
-                            minValue:0
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 4 ? 4 :(arr[1].length < 2? 2 : arr[1].length))).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                    }, 
-                    {
-                        text : "税率", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "pd_taxrate", 
-                        width : 80.0,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 0,
-                            minValue: 0,
-                            maxValue: 100
-                        },
-                        renderer : function(v) {
-                            return Ext.util.Format.number(v, '0');
-                        }
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "含税单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_price",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
                     },
-                    {
-                        text : "已转数", 
-                        dataIndex : "pd_yqty", 
-                        xtype: 'numbercolumn',
-                        width : 0,
-                        hidden:true,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 3,
-                            editable : false
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        }
-                    },{
-                        text : "需求日期", 
-                        dataIndex : "pd_delivery", 
-                        xtype:'datecolumn',
-                        width : 110.0, 
-                        editor : {
-                            xtype : "datefield",
-                            editable : false, 
-                            hideTrigger : false
-                        }
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
                     },
-                    {
-                        text : "含税金额", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "pd_total", 
-                        width : 110.0, 
-                        // editor : {
-                        //     xtype : "numberfield",
-                        //     decimalPrecision: 2,
-                        //     editable : false
-                        // },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        }
-                    }, 
-                    {
-                        text : "未税金额", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "pd_taxtotal", 
-                        width : 110.0,
-                        // editor : {
-                        //     xtype : "numberfield",
-                        //     decimalPrecision: 2,
-                        //     editable : false
-                        // },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
+                    listeners: {
+                        edit: function (value, grid) {
+                            var r = grid.getSelection()[0],
+                                pd_taxrate = r.get('pd_taxrate');
+                            r.set('pd_taxprice', value / (1 + pd_taxrate / 100));
                         }
+                    }
+                }, {
+                    text: "金额",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxtotal",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
                     },
-                    {
-                        text : "最小包装数", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "pr_zxbzs",
-                        width : 110.0,
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v; 
-                        }
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "税率",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxrate",
+                    width: 80,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 0,
+                        minValue: 0,
+                        maxValue: 100
                     },
-                    {
-                        text : "关联销售单号", 
-                        dataIndex : "pd_salecode", 
-                        width : 150.0,
-                        ignore:true,
-                    },{
-                        text : "备注", 
-                        dataIndex : "pd_remark",
-                        width : 250, 
-                        items : null,
-                        editor : {
-                            xtype : "textfield"
-                        },
+                    renderer: function (v) {
+                        return Ext.util.Format.number(v, '0');
+                    }
+                }, {
+                    text: "税额",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxamount",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "价税合计",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_total",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
                     }
-                ]
+                }, {
+                    text: "需求日期",
+                    dataIndex: "pd_delivery",
+                    xtype: 'datecolumn',
+                    width: 110.0,
+                    editor: {
+                        xtype: "datefield",
+                        editable: false,
+                        hideTrigger: false
+                    }
+                }, {
+                    text: "最小包装数",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pr_zxbzs",
+                    width: 110.0,
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "关联销售单号",
+                    dataIndex: "pd_salecode",
+                    width: 150.0,
+                    ignore: true,
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
             }, {
-                xtype : "textfield", 
-                name : "pu_remark", 
-                fieldLabel : "备注", 
-                columnWidth : 1
+                xtype: "textfield",
+                name: "pu_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
             }, {
-                xtype : "datefield", 
-                name : "pu_date", 
-                fieldLabel : "单据日期", 
+                xtype: "datefield",
+                name: "pu_date",
+                fieldLabel: "单据日期",
                 defaultValue: new Date()
             }, {
-                xtype : "textfield", 
-                name : "pu_currency",
-                fieldLabel : "币别", 
-                readOnly:true,
-                defaultValue:'RMB'
+                xtype: "textfield",
+                name: "pu_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            }, {
+                xtype: "textfield",
+                name: "pu_total",
+                fieldLabel: "采购金额",
+                readOnly: true,
+                columnWidth: 0.25,
+            }, {
+                xtype: "hidden",
+                name: "pu_buyercode",
+                fieldLabel: "采购员编号"
+            }, {
+                xtype: "employeeDbfindTrigger",
+                name: "pu_buyername",
+                fieldLabel: "采购员",
+                columnWidth: 0.25
             }, {
-                xtype : "textfield", 
-                name : "pu_total", 
-                fieldLabel : "采购金额",
-                readOnly:true,
-                columnWidth : 0.25,
-            },{
-                xtype : "hidden", 
-                name : "pu_buyercode", 
-                fieldLabel : "采购员编号"
-            },{
-                xtype : "employeeDbfindTrigger", 
-                name : "pu_buyername", 
-                fieldLabel : "采购员",
-                columnWidth : 0.25
-            },{
-                xtype : "hidden", 
-                name : "pu_buyerid", 
-                fieldLabel : "采购员ID"
-            },
-            {
-                xtype : "hidden", 
-                name : "creatorId", 
-                fieldLabel : "录入人ID", 
-                readOnly:true
-            },
-            {
-                xtype : "textfield", 
-                name : "creatorName", 
-                fieldLabel : "录入人", 
-                readOnly:true
+                xtype: "hidden",
+                name: "pu_buyerid",
+                fieldLabel: "采购员ID"
             }, {
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "录入日期",
-                readOnly:true, 
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
                 defaultValue: new Date()
-            },{
-                xtype : "hidden", 
-                name : "updaterId", 
-                fieldLabel : "更新人ID", 
-                readOnly:true
-            },{
-                xtype : "hidden", 
-                name : "updaterName", 
-                fieldLabel : "更新人", 
-                readOnly:true
             }, {
-                xtype : "hidden", 
-                name : "updateTime", 
-                fieldLabel : "更新日期",
-                readOnly:true, 
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
                 defaultValue: new Date()
             }, {
-                xtype : "textfield", 
-                name : "pu_auditman", 
-                fieldLabel : "审核人", 
-                readOnly:true
+                xtype: "textfield",
+                name: "pu_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
             }, {
-                xtype : "datefield", 
-                name : "pu_auditdate", 
-                fieldLabel : "审核日期",
-                readOnly:true
+                xtype: "datefield",
+                name: "pu_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
             }]
         });
         this.callParent();
     },
-     toolBtns: [{
-         xtype: 'button',
-         text: '转采购验收单',
-         hidden: true,
-         bind: {
+    toolBtns: [{
+        xtype: 'button',
+        text: '转采购验收单',
+        hidden: true,
+        bind: {
             hidden: '{turnHidden}'
         },
-         handler: 'turnIn'
-     }],
-     initFormData: function(data) {
+        handler: 'turnIn'
+    }],
+    initFormData: function (data) {
         var me = this;
         me.setFormData(data);
-        if(data.main.pu_statuscode!='AUDITED'&&!data.main.pu_shipaddresscode){
+        if (data.main.pu_statuscode != 'AUDITED' && !data.main.pu_shipaddresscode) {
             //读取默认地址
             saas.util.BaseUtil.request({
-                url: '/api/document/address/getDefault',
-                method: 'GET',
-            })
-            .then(function (localJson) {
-                var data = localJson.data;
-                if(data&&data.ad_address){
-                    var f = me.down('[name=pu_shipaddresscode]');
-                    f.setValue(data.ad_address)
-                }else{
-                    saas.util.BaseUtil.showErrorToast('未设置默认采购交货地址,维护后新增会自动给采购交货地址赋默认值');
-                }
-            })
-            .catch(function (res) {
-                saas.util.BaseUtil.showErrorToast('获取默认采购交货地址失败' + res.message);
-            });
+                    url: '/api/document/address/getDefault',
+                    method: 'GET',
+                })
+                .then(function (localJson) {
+                    var data = localJson.data;
+                    if (data && data.ad_address) {
+                        var f = me.down('[name=pu_shipaddresscode]');
+                        f.setValue(data.ad_address)
+                    } else {
+                        saas.util.BaseUtil.showErrorToast('未设置默认采购交货地址,维护后新增会自动给采购交货地址赋默认值');
+                    }
+                })
+                .catch(function (res) {
+                    saas.util.BaseUtil.showErrorToast('获取默认采购交货地址失败' + res.message);
+                });
         }
         me.clearDirty();
     }

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

@@ -113,22 +113,43 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '供应商名称',
             dataIndex: 'pu_vendname',
-            width:250
+            width:200
         }, {
-            text: '总金额',
+            text: '金额(元)',
+            dataIndex: 'pu_taxtotal',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '价税合计(元)',
             dataIndex: 'pu_total',
             xtype: 'numbercolumn',
-            width: 110
+            width: 110,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '审核状态',
             align: 'center',
             dataIndex: 'pu_status',
-            width: 90
+            width: 80
         },{
             text: '业务状态',
             align: 'center',
             dataIndex: 'pu_acceptstatus',
-            width: 90
+            width: 80
+        },{
+            text: '采购员',
+            dataIndex: 'pu_buyername',
+            width: 80
         },{
             text: '关联销售单',
             dataIndex: 'pu_sacode',
@@ -156,22 +177,17 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '供应商名称',
             dataIndex: 'pu_vendname',
-            width: 150
+            width: 200
         }, {
             text: '审核状态',
             align: 'center',
             dataIndex: 'pu_status',
-            width: 90
-        },{
-            text: '业务状态',
-            align: 'center',
-            dataIndex: 'pu_acceptstatus',
-            width: 90
+            width: 80
         }, {
             text: '序号',
             dataIndex: 'pd_detno',
             xtype: 'numbercolumn',
-            width: 80, 
+            width: 65, 
             renderer : function(v) {
                 return Ext.util.Format.number(v, '0');
             }
@@ -182,19 +198,19 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         },{
             text: '品牌',
             dataIndex: 'pr_brand',
-            width: 150
+            width: 100
         },{
-            text: '名称',
+            text: '物料名称',
             dataIndex: 'pr_detail',
-            width: 200
+            width: 150
         },{
             text: '型号',
             dataIndex: 'pr_orispeccode',
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
-            width: 150
+            dataIndex: 'pr_spec',
+            width: 200
         },{
             text: '采购数量',
             dataIndex: 'pd_qty',
@@ -209,10 +225,10 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '单位',
             dataIndex: 'pr_unit',
-            width: 80
+            width: 65
         }, {
             text: '单价(元)',
-            dataIndex: 'pd_price',
+            dataIndex: 'pd_taxprice',
             xtype: 'numbercolumn',
             width: 110,
             renderer : function(v) {
@@ -221,21 +237,31 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                 var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
             }
-        }, {
-            text: '需求日期',
-            dataIndex: 'pd_delivery',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '税率',
-            dataIndex: 'pd_taxrate',
+        },{
+            text: '金额(元)',
+            dataIndex: 'pd_taxtotal',
             xtype: 'numbercolumn',
-            width: 80,
+            width: 110,
             renderer : function(v) {
-                return Ext.util.Format.number(v, '0');
-            },
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        },{
+            text: '税额',
+            dataIndex: 'pd_taxamount',
+            xtype: 'numbercolumn',
+            width: 110,
+            renderer : function(v,g,r) {
+                v = (r.data["pd_total"]||0.0) - (r.data["pd_taxtotal"]||0.0);
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
         },{
-            text: '金额',
+            text: '价税合计(元)',
             dataIndex: 'pd_total',
             xtype: 'numbercolumn',
             width: 110,
@@ -245,7 +271,11 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                 var format = '0,000.' + xr.join('');
                 return Ext.util.Format.number(v, format);
             }
-        },{
+        }, {
+            text: '关联销售单号',
+            dataIndex: 'pd_salecode',
+            width: 150
+        }, {
             text: '备注',
             dataIndex: 'pd_remark',
             width: 250

+ 372 - 378
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -6,32 +6,32 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     viewModel: 'purchase-purchasein-formpanel',
 
     viewName: 'purchase-purchasein-formpanel',
-    caller:'PurchaseIn',
-    
-     //字段属性
-    _title:'采购验收单',
+    caller: 'PurchaseIn',
+
+    //字段属性
+    _title: '采购验收单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/purchase/prodinout/read',
-    _saveUrl:'/api/purchase/prodinout/save',
-    _auditUrl:'/api/purchase/prodinout/audit',
-    _unAuditUrl:'/api/purchase/prodinout/unAudit',
-    _deleteUrl:'/api/purchase/prodinout/delete',
-    _turnOutUrl:'/api/purchase/prodinout/turnProdOut',
-    initId:0,
+    _readUrl: '/api/purchase/prodinout/read',
+    _saveUrl: '/api/purchase/prodinout/save',
+    _auditUrl: '/api/purchase/prodinout/audit',
+    _unAuditUrl: '/api/purchase/prodinout/unAudit',
+    _deleteUrl: '/api/purchase/prodinout/delete',
+    _turnOutUrl: '/api/purchase/prodinout/turnProdOut',
+    initId: 0,
 
     toolBtns: [{
         xtype: 'button',
         text: '转采购验退单',
         hidden: true,
         bind: {
-           hidden: '{turnHidden}'
-       },
+            hidden: '{turnHidden}'
+        },
         handler: 'turnOut'
     }],
     defaultItems: [{
@@ -40,20 +40,20 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    },{
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "pi_vendid", 
-        fieldLabel : "供应商ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
+    }, {
+        xtype: "hidden",
+        name: "pi_class",
+        fieldLabel: "单据类型",
+        readOnly: true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: "hidden",
+        name: "pi_vendid",
+        fieldLabel: "供应商ID",
+        allowBlank: true,
+        columnWidth: 0.0
+    }, {
         xtype: 'hidden',
         name: 'pi_vendcode',
         fieldLabel: '供应商编号'
@@ -61,383 +61,377 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype: 'vendorDbfindTrigger',
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
-        allowBlank : false,
-    },{
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
+        allowBlank: false,
+    }, {
+        xtype: "datefield",
+        name: "pi_date",
+        fieldLabel: "单据日期",
+        allowBlank: false,
+        columnWidth: 0.25,
         defaultValue: new Date()
-    },{
-        xtype : "textfield", 
-        name : "pi_total", 
-        fieldLabel : "总额", 
-        allowBlank : true,
+    }, {
+        xtype: "textfield",
+        name: "pi_total",
+        fieldLabel: "总额",
+        allowBlank: true,
         readOnly: true,
-        columnWidth : 0.25
+        columnWidth: 0.25
     }, {
-        xtype : "hidden", 
-        name : "pi_puid", 
-        fieldLabel : "采购单id", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "pi_pucode", 
-        fieldLabel : "采购单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        xtype: "hidden",
+        name: "pi_puid",
+        fieldLabel: "采购单id",
+        allowBlank: true,
+        columnWidth: 0.25
     }, {
-        name : "detailGridField", 
-        xtype : "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail',
-        deleteDetailUrl:'/api/purchase/prodinout/deleteDetail',
-        detnoColumn:  'pd_pdno',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            },{
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            },
-            {
-                text : "品牌", 
-                width : 150.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+        xtype: "hidden",
+        name: "pi_pucode",
+        fieldLabel: "采购单号",
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        name: "detailGridField",
+        xtype: "detailGridField",
+        storeModel: 'saas.model.purchase.ProdInDetail',
+        deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
+        detnoColumn: 'pd_pdno',
+        columns: [{
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料id",
+            dataIndex: "pd_prodid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料编号",
+            width: 150.0,
+            dataIndex: "pd_prodcode",
+            xtype: "",
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "productMultiDbfindTrigger"
+            }
+        }, {
+            text: "品牌",
+            width: 150.0,
+            dataIndex: "pr_brand",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },
-            {
-                text : "名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "名称",
+            width: 200.0,
+            dataIndex: "pr_detail",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "型号",
+            width: 200.0,
+            dataIndex: "pr_orispeccode",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "规格", 
-                width : 150, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "规格",
+            width: 150,
+            dataIndex: "pr_spec",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
+                return v;
+            }
+        }, {
+            text: 'model映射需要',
+            dataIndex: 'productDTO',
+            hidden: true,
+        }, {
+            text: "数量",
+            dataIndex: "pd_inqty",
+            xtype: 'numbercolumn',
+            width: 110.0,
+            allowBlank: false,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 3,
+                minValue: 0
             },
-            {
-                text : "数量", 
-                dataIndex : "pd_inqty", 
-                xtype: 'numbercolumn',
-                width : 110.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "单价(元)",
-                xtype: 'numbercolumn', 
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                dataIndex : "pd_orderprice", 
-                width : 120.0,
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-            }, {
-                text : "已转数", 
-                dataIndex : "pd_yqty",
-                xtype: 'numbercolumn',
-                hidden:true, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    editable : false
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "单位",
+            width: 80.0,
+            dataIndex: "pr_unit",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "仓库id", 
-                dataIndex : "pd_whid", 
-                xtype : "numbercolumn",
-                hidden:true
+                return v;
+            }
+        }, {
+            text: "单价(元)",
+            xtype: 'numbercolumn',
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                text : "仓库编号", 
-                dataIndex : "pd_whcode",
-                hidden:true
+            dataIndex: "pd_netprice",
+            width: 120.0,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                width : 150.0, 
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
-                }
+        }, {
+            text: "含税单价(元)",
+            xtype: 'numbercolumn',
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                xtype: 'numbercolumn',
-                text : "税率", 
-                dataIndex : "pd_taxrate", 
-                width : 80.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                },
-                renderer : function(v) {
-                    return Ext.util.Format.number(v, '0');
-                },
-            },{
-                text : "含税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 110.0, 
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable : false
-                // },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                }
+            dataIndex: "pd_orderprice",
+            width: 120.0,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "未税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 110.0, 
-                // editor : {
-                //     xtype : "numberfield",
-                //     decimalPrecision: 2,
-                //     editable : false
-                // },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            listeners: {
+                edit: function (value, grid) {
+                    var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_taxrate');
+                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
                 }
+            }
+        }, {
+            text: "金额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_nettotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            xtype: 'numbercolumn',
+            text: "税率",
+            dataIndex: "pd_taxrate",
+            width: 80,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 0,
+                minValue: 0,
+                maxValue: 100
+            },
+            renderer: function (v) {
+                return Ext.util.Format.number(v, '0');
+            },
+        }, {
+            text: "税额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxamount",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "采购单明细id", 
-                dataIndex : "pd_orderid", 
-                ignore:true,
-                hidden:true
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "价税合计",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_ordertotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "采购单号", 
-                dataIndex : "pd_ordercode", 
-                width : 150.0,
-                ignore:true,
-            },{
-                text : "采购序号",
-                dataIndex : "pd_orderdetno", 
-                xtype : "numbercolumn",
-                width : 110.0,
-                format: '0',
-                ignore:true,
-                renderer: function(v) {
-                    if(v) {
-                        return Ext.util.Format.number(v, '0');
-                    }else {
-                        return null;
-                    }
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "仓库id",
+            dataIndex: "pd_whid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "仓库编号",
+            dataIndex: "pd_whcode",
+            hidden: true
+        }, {
+            text: "仓库",
+            dataIndex: "pd_whname",
+            width: 150.0,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "warehouseDbfindTrigger"
+            }
+        }, {
+            text: "采购单明细id",
+            dataIndex: "pd_orderid",
+            ignore: true,
+            hidden: true
+        }, {
+            text: "采购单号",
+            dataIndex: "pd_ordercode",
+            width: 150.0,
+            ignore: true,
+        }, {
+            text: "采购序号",
+            dataIndex: "pd_orderdetno",
+            xtype: "numbercolumn",
+            width: 110.0,
+            format: '0',
+            ignore: true,
+            renderer: function (v) {
+                if (v) {
+                    return Ext.util.Format.number(v, '0');
+                } else {
+                    return null;
                 }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
             }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },
-    {
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
-    },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
+        }, {
+            text: "备注",
+            dataIndex: "pd_remark",
+            width: 250,
+            items: null,
+            editor: {
+                xtype: "textfield"
+            },
+        }]
+    }, {
+        xtype: "textfield",
+        name: "pi_remark",
+        fieldLabel: "备注",
+        columnWidth: 1
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "creatorId",
+        fieldLabel: "录入人ID",
+        readOnly: true
+    }, {
+        xtype: "textfield",
+        name: "creatorName",
+        fieldLabel: "录入人",
+        readOnly: true
+    }, {
+        xtype: "datefield",
+        name: "createTime",
+        fieldLabel: "录入日期",
+        readOnly: true,
         defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
     }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "updaterId",
+        fieldLabel: "更新人ID",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updaterName",
+        fieldLabel: "更新人",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updateTime",
+        fieldLabel: "更新日期",
+        readOnly: true,
         defaultValue: new Date()
     }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "pi_auditman",
+        fieldLabel: "审核人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
+        xtype: "datefield",
+        name: "pi_auditdate",
+        fieldLabel: "审核日期",
+        readOnly: true
     }],
-    beforeAudit:function(){
+    beforeAudit: function () {
         var me = this,
-        viewModel = me.getViewModel(),
-        grid = me.down('detailGridField'),
-        data = grid.getTrueData();
-        Ext.Array.each(data,function(item){
-            if(item.pd_orderprice==0){
-                saas.util.BaseUtil.showErrorToast(item.pd_pdno+'行'+item.pd_prodcode+'物料单价为0');
+            viewModel = me.getViewModel(),
+            grid = me.down('detailGridField'),
+            data = grid.getTrueData();
+        Ext.Array.each(data, function (item) {
+            if (item.pd_orderprice == 0) {
+                saas.util.BaseUtil.showErrorToast(item.pd_pdno + '行' + item.pd_prodcode + '物料单价为0');
             }
         });
         return true;

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

@@ -202,7 +202,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '数量',

+ 365 - 335
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -6,23 +6,23 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     viewModel: 'purchase-purchaseout-formpanel',
 
     viewName: 'purchase-purchaseout-formpanel',
-    caller:'PurchaseOut',
-    
-     //字段属性
-    _title:'采购验退单',
+    caller: 'PurchaseOut',
+
+    //字段属性
+    _title: '采购验退单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/purchase/prodinout/read',
-    _saveUrl:'/api/purchase/prodinout/save',
-    _auditUrl:'/api/purchase/prodinout/audit',
-    _unAuditUrl:'/api/purchase/prodinout/unAudit',
-    _deleteUrl:'/api/purchase/prodinout/delete',
-    initId:0,
+    _readUrl: '/api/purchase/prodinout/read',
+    _saveUrl: '/api/purchase/prodinout/save',
+    _auditUrl: '/api/purchase/prodinout/audit',
+    _unAuditUrl: '/api/purchase/prodinout/unAudit',
+    _deleteUrl: '/api/purchase/prodinout/delete',
+    initId: 0,
     toolBtns: [],
     defaultItems: [{
         xtype: 'hidden',
@@ -30,25 +30,25 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    },{
+    }, {
         xtype: 'hidden',
         name: 'pi_ioid',
         fieldLabel: 'pi_ioid'
-    },{
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : true, 
-        columnWidth : 0.25
     }, {
-        xtype : "hidden", 
-        name : "pi_vendid", 
-        fieldLabel : "供应商ID", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0.0
-    },{
+        xtype: "hidden",
+        name: "pi_class",
+        fieldLabel: "单据类型",
+        readOnly: true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: "hidden",
+        name: "pi_vendid",
+        fieldLabel: "供应商ID",
+        allowBlank: true,
+        hidden: true,
+        columnWidth: 0.0
+    }, {
         xtype: 'hidden',
         name: 'pi_vendcode',
         fieldLabel: '供应商编号'
@@ -56,333 +56,363 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         xtype: 'vendorDbfindTrigger',
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
-        allowBlank : false,
-    },{
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
+        allowBlank: false,
+    }, {
+        xtype: "datefield",
+        name: "pi_date",
+        fieldLabel: "单据日期",
+        allowBlank: false,
+        columnWidth: 0.25,
         defaultValue: new Date()
-    },{
-        xtype : "textfield", 
-        name : "pi_total", 
-        fieldLabel : "总额", 
-        allowBlank : true,
+    }, {
+        xtype: "textfield",
+        name: "pi_total",
+        fieldLabel: "总额",
+        allowBlank: true,
         readOnly: true,
-        columnWidth : 0.25
+        columnWidth: 0.25
     }, {
-        xtype : "hidden", 
-        name : "pi_puid", 
-        fieldLabel : "采购单id", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "pi_pucode", 
-        fieldLabel : "采购单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        xtype: "hidden",
+        name: "pi_puid",
+        fieldLabel: "采购单id",
+        allowBlank: true,
+        columnWidth: 0.25
     }, {
-        name : "detailGridField", 
-        xtype : "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail',
-        deleteDetailUrl:'/api/purchase/prodinout/deleteDetail',
-        detnoColumn:  'pd_pdno',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            },{
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 150.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 150, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+        xtype: "hidden",
+        name: "pi_pucode",
+        fieldLabel: "采购单号",
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        name: "detailGridField",
+        xtype: "detailGridField",
+        storeModel: 'saas.model.purchase.ProdOutDetail',
+        deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
+        detnoColumn: 'pd_pdno',
+        columns: [{
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料id",
+            dataIndex: "pd_prodid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料编号",
+            width: 150.0,
+            dataIndex: "pd_prodcode",
+            xtype: "",
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "productMultiDbfindTrigger"
+            }
+        }, {
+            text: 'model映射需要',
+            dataIndex: 'productDTO',
+            hidden: true,
+        }, {
+            text: "品牌",
+            width: 150.0,
+            dataIndex: "pr_brand",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "数量", 
-                dataIndex : "pd_outqty", 
-                width : 110.0,
-                xtype: 'numbercolumn',
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "名称",
+            width: 200.0,
+            dataIndex: "pr_detail",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "型号",
+            width: 200.0,
+            dataIndex: "pr_orispeccode",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单价(元)",
-                xtype: 'numbercolumn', 
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                dataIndex : "pd_orderprice", 
-                width : 120.0,
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-            }, {
-                text : "仓库id", 
-                dataIndex : "pd_whid", 
-                xtype : "numbercolumn",
-                hidden:true
-            }, {
-                text : "仓库编号", 
-                dataIndex : "pd_whcode",
-                hidden:true
-            }, {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                width : 150.0, 
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
+                return v;
+            }
+        }, {
+            text: "规格",
+            width: 150,
+            dataIndex: "pr_spec",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            }, {
-                text : "税率", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_taxrate", 
-                width : 80.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                },
-                renderer : function(v) {
-                    return Ext.util.Format.number(v, '0');
-                },
-            }, 
-            {
-                text : "含税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 110.0, 
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "数量",
+            dataIndex: "pd_outqty",
+            width: 110.0,
+            xtype: 'numbercolumn',
+            allowBlank: false,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 3,
+                minValue: 0
+            },
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "单位",
+            width: 80.0,
+            dataIndex: "pr_unit",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
+                return v;
+            }
+        }, {
+            text: "单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_netprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
+            },
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+        }, {
+            text: "含税单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_orderprice",
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
+            },
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "未税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 110.0, 
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            listeners: {
+                edit: function (value, grid) {
+                    var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_taxrate');
+                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
                 }
-            }, {
-                text : "验收明细id", 
-                dataIndex : "pd_ioid", 
-                hidden:true
-            }, {
-                text : "验收单号", 
-                dataIndex : "iocode", 
-                width : 150.0,
-                ignore:true
-            }, {
-                text : "验收序号", 
-                dataIndex : "iodetno", 
-                xtype : "numbercolumn", 
-                width : 110.0,
-                ignore:true,
-                renderer: function(v) {
-                    if(v) {
-                        return Ext.util.Format.number(v, '0');
-                    }else {
-                        return null;
-                    }
+            }
+        }, {
+            text: "金额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_nettotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "税率",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxrate",
+            width: 80,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 0,
+                minValue: 0,
+                maxValue: 100
+            },
+            renderer: function (v) {
+                return Ext.util.Format.number(v, '0');
+            },
+        }, {
+            text: "税额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxamount",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "价税合计",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_ordertotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "仓库id",
+            dataIndex: "pd_whid",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "仓库编号",
+            dataIndex: "pd_whcode",
+            hidden: true
+        }, {
+            text: "仓库",
+            dataIndex: "pd_whname",
+            width: 150.0,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "warehouseDbfindTrigger"
+            }
+        }, {
+            text: "验收明细id",
+            dataIndex: "pd_ioid",
+            hidden: true
+        }, {
+            text: "验收单号",
+            dataIndex: "iocode",
+            width: 150.0,
+            ignore: true
+        }, {
+            text: "验收序号",
+            dataIndex: "iodetno",
+            xtype: "numbercolumn",
+            width: 110.0,
+            ignore: true,
+            renderer: function (v) {
+                if (v) {
+                    return Ext.util.Format.number(v, '0');
+                } else {
+                    return null;
                 }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
             }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },
-    {
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
-    },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
+        }, {
+            text: "备注",
+            dataIndex: "pd_remark",
+            width: 250,
+            items: null,
+            editor: {
+                xtype: "textfield"
+            },
+        }]
+    }, {
+        xtype: "textfield",
+        name: "pi_remark",
+        fieldLabel: "备注",
+        columnWidth: 1
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "creatorId",
+        fieldLabel: "录入人ID",
+        readOnly: true
+    }, {
+        xtype: "textfield",
+        name: "creatorName",
+        fieldLabel: "录入人",
+        readOnly: true
+    }, {
+        xtype: "datefield",
+        name: "createTime",
+        fieldLabel: "录入日期",
+        readOnly: true,
         defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
     }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "updaterId",
+        fieldLabel: "更新人ID",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updaterName",
+        fieldLabel: "更新人",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updateTime",
+        fieldLabel: "更新日期",
+        readOnly: true,
         defaultValue: new Date()
     }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "pi_auditman",
+        fieldLabel: "审核人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
+        xtype: "datefield",
+        name: "pi_auditdate",
+        fieldLabel: "审核日期",
+        readOnly: true
     }]
 });

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

@@ -225,7 +225,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
                 width: 200
             },{
                 text: '规格',
-                dataIndex: 'pr_spce',
+                dataIndex: 'pr_spec',
                 width: 150
             },{
                 text: '数量',

+ 368 - 359
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -6,52 +6,52 @@ Ext.define('saas.view.sale.sale.FormPanel', {
     viewModel: 'sale-sale-formpanel',
 
     viewName: 'sale-sale-formpanel',
-    caller:'Sale',
-    
-     //字段属性
-     _title:'销售订单',
-     _idField: 'id',
-     _codeField: 'sa_code',
-     _statusField: 'sa_status',
-     _statusCodeField: 'sa_statuscode',
-     _auditmanField: 'sa_auditman',
-     _auditdateField:'sa_auditdate',
-     _relationColumn: 'sd_puid',
-     _readUrl:'/api/sale/sale/read',
-     _saveUrl:'/api/sale/sale/save',
-     _auditUrl:'/api/sale/sale/audit',
-     _unAuditUrl: '/api/sale/sale/unAudit',
-     _deleteUrl:'/api/sale/sale/delete',
-     _turnOutUrl:'/api/sale/sale/turnProdOut',
-     _turnPurchase:'/api/sale/sale/saleTurnPurchase',
-     initId:0,
-     initComponent:function() {
-        Ext.applyIf(this,{
+    caller: 'Sale',
+
+    //字段属性
+    _title: '销售订单',
+    _idField: 'id',
+    _codeField: 'sa_code',
+    _statusField: 'sa_status',
+    _statusCodeField: 'sa_statuscode',
+    _auditmanField: 'sa_auditman',
+    _auditdateField: 'sa_auditdate',
+    _relationColumn: 'sd_puid',
+    _readUrl: '/api/sale/sale/read',
+    _saveUrl: '/api/sale/sale/save',
+    _auditUrl: '/api/sale/sale/audit',
+    _unAuditUrl: '/api/sale/sale/unAudit',
+    _deleteUrl: '/api/sale/sale/delete',
+    _turnOutUrl: '/api/sale/sale/turnProdOut',
+    _turnPurchase: '/api/sale/sale/saleTurnPurchase',
+    initId: 0,
+    initComponent: function () {
+        Ext.applyIf(this, {
             defaultItems: [{
                 xtype: 'hidden',
                 name: 'id',
                 fieldLabel: 'id'
             }, {
-                xtype : 'hidden',
-                name : 'sa_custid', 
-                fieldLabel : '客户ID'
-            }
-            , {
-                xtype : 'hidden', 
-                name : 'sa_custcode', 
-                fieldLabel : '客户编号'
+                xtype: 'hidden',
+                name: 'sa_custid',
+                fieldLabel: '客户ID'
+            }, {
+                xtype: 'hidden',
+                name: 'sa_custcode',
+                fieldLabel: '客户编号'
             }, {
-                xtype : "customerDbfindTrigger", 
-                name : "sa_custname", 
-                fieldLabel : "客户名称",
-                allowBlank : false,
-                setValue:function(value){
-                    var me = this,bind, valueBind;
+                xtype: "customerDbfindTrigger",
+                name: "sa_custname",
+                fieldLabel: "客户名称",
+                allowBlank: false,
+                setValue: function (value) {
+                    var me = this,
+                        bind, valueBind;
                     var form = me.ownerCt;
                     var c = form.down('[name=sa_toplace]');
-                    if(value&&value!=''){
+                    if (value && value != '') {
                         c.setDisabled(false);
-                    }else{
+                    } else {
                         c.setDisabled(true);
                     }
                     if (me.hasFocus) {
@@ -67,11 +67,10 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     } else {
                         me.lastSelectedRecords = null;
                     }
-            
+
                     if (value != null) {
                         me.doSetValue(value);
-                    }
-                    else {
+                    } else {
                         me.suspendEvent('select');
                         me.valueCollection.beginUpdate();
                         me.pickerSelectionModel.deselectAll();
@@ -81,347 +80,357 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     return me;
                 }
             }, {
-                name : "sa_toplace", 
-                xtype : "remotecombo", 
-                fieldLabel : "交货地址", 
-                editable:false,
-                allowBlank : false, 
-                columnWidth : 0.5,
-                storeUrl:'/api/document/customer/getAddressCombo',
-                hiddenBtn:true,//true 则会关闭新增按钮功能
+                name: "sa_toplace",
+                xtype: "remotecombo",
+                fieldLabel: "交货地址",
+                editable: false,
+                allowBlank: false,
+                columnWidth: 0.5,
+                storeUrl: '/api/document/customer/getAddressCombo',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
-                name : "detailGridField", 
-                xtype : "detailGridField", 
+                name: "detailGridField",
+                xtype: "detailGridField",
                 detnoColumn: 'sd_detno',
-                storeModel:'saas.model.sale.Saledetail',
-                deleteDetailUrl:'/api/sale/sale/deleteDetail',
-                columns : [
-                   {
-                        text : "id", 
-                        dataIndex : "id", 
-                        xtype : "numbercolumn",
-                        hidden:true
-                    }, {
-                        text : "物料id", 
-                        dataIndex : "sd_prodid", 
-                        width : 0
-                    }, {
-                        text : "物料编号", 
-                        width : 150.0, 
-                        dataIndex : "sd_prodcode", 
-                        xtype : "", 
-                        items : null,
-                        allowBlank:false,
-                        editor : {
-                            displayField : "display", 
-                            editable : true, 
-                            format : "", 
-                            hideTrigger : false, 
-                            maxLength : 100.0, 
-                            minValue : null, 
-                            positiveNum : false, 
-                            queryMode : "local", 
-                            store : null, 
-                            valueField : "value", 
-                            xtype : "productMultiDbfindTrigger"
-                        }
-                    },{
-                        text: 'model映射需要',
-                        dataIndex: 'productDTO',
-                        hidden: true,
-                    },
-                    {
-                        text : "品牌", 
-                        width : 150.0, 
-                        dataIndex : "pr_brand",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },
-                    {
-                        text : "名称", 
-                        width : 200.0, 
-                        dataIndex : "pr_detail",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },
-                    {
-                        text : "型号", 
-                        width : 200.0, 
-                        dataIndex : "pr_orispeccode",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },{
-                        text : "规格", 
-                        width : 150, 
-                        dataIndex : "pr_spec",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
-                        }
-                    },{
-                        text : "数量", 
-                        dataIndex : "sd_qty", 
-                        width : 110.0,
-                        xtype: 'numbercolumn',
-                        allowBlank:false, 
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 3,
-                            minValue:0
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        }
-                    },{
-                        text : "单位", 
-                        width : 80.0, 
-                        dataIndex : "pr_unit",
-                        ignore:true,
-                        renderer: function (v, m, r) {
-                            if(!v){
-                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                            }                     
-                            return v;
+                storeModel: 'saas.model.sale.Saledetail',
+                deleteDetailUrl: '/api/sale/sale/deleteDetail',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "sd_prodid",
+                    width: 0
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "sd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 150.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },{
-                        text : "单价(元)", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "sd_price", 
-                        width : 110.0,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 4,
-                            minValue:0
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 4 ? 4 :(arr[1].length < 2? 2 : arr[1].length))).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                       }
-                    },   {
-                        text : "已转数", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "sd_yqty", 
-                        width : 0, 
-                        hidden : true,
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 3
-                        },
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                            var format = '0.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
+                        return v;
+                    }
+                }, {
+                    text: "名称",
+                    width: 200.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    }, {
-                        text : "税率", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "sd_taxrate", 
-                        width : 80.0, 
-                        editor : {
-                            xtype : "numberfield",
-                            decimalPrecision: 0,
-                            minValue: 0,
-                            maxValue: 100
-                        },
-                        renderer : function(v) {
-                            return Ext.util.Format.number(v, '0');
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    },{
-                        text : "交货日期", 
-                        dataIndex : "sd_delivery", 
-                        width : 110.0, 
-                        xtype:'datecolumn',
-                        editor : {
-                            xtype : "datefield",
-                            editable : true, 
-                            hideTrigger : false
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 150,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
+                        return v;
+                    }
+                }, {
+                    text: "数量",
+                    dataIndex: "sd_qty",
+                    width: 110.0,
+                    xtype: 'numbercolumn',
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                        var format = '0.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
                     },
-                    {
-                        text : "含税金额", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "sd_total", 
-                        width : 110.0,
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                        var format = '0.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "单位",
+                    width: 80.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                         }
-                    }, 
-                    {
-                        text : "未税金额", 
-                        xtype: 'numbercolumn',
-                        dataIndex : "sd_nettotal", 
-                        width : 110.0,
-                        renderer : function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
-                        },
-                        summaryType: 'sum',
-                        summaryRenderer: function(v) {
-                            var arr = (v + '.').split('.');
-                            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                            var format = '0,000.' + xr.join('');
-                            return Ext.util.Format.number(v, format);
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_netprice",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "含税单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_price",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 4 ? 4 : (arr[1].length < 2 ? 2 : arr[1].length))).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    listeners: {
+                        edit: function (value, grid) {
+                            var r = grid.getSelection()[0],
+                                sd_taxrate = r.get('sd_taxrate');
+                            r.set('sd_netprice', value / (1 + sd_taxrate / 100));
                         }
-                    },{
-                        text : "备注", 
-                        dataIndex : "sd_remark",
-                        width : 250, 
-                        items : null,
-                        editor : {
-                            xtype : "textfield"
-                        },
                     }
-                ]
+                }, {
+                    text: "金额",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_nettotal",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "税率",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_taxrate",
+                    width: 80,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 0,
+                        minValue: 0,
+                        maxValue: 100
+                    },
+                    renderer: function (v) {
+                        return Ext.util.Format.number(v, '0');
+                    }
+                }, {
+                    text: "税额",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_taxamount",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "价税合计",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sd_total",
+                    width: 120,
+                    renderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        var arr = (v + '.').split('.');
+                        var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                        var format = '0,000.' + xr.join('');
+                        return Ext.util.Format.number(v, format);
+                    }
+                }, {
+                    text: "交货日期",
+                    dataIndex: "sd_delivery",
+                    width: 110.0,
+                    xtype: 'datecolumn',
+                    editor: {
+                        xtype: "datefield",
+                        editable: true,
+                        hideTrigger: false
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "sd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
             }, {
-                xtype : "textfield", 
-                name : "sa_remark", 
-                fieldLabel : "备注", 
-                columnWidth : 1
+                xtype: "textfield",
+                name: "sa_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
             }, {
-                xtype : "datefield", 
-                name : "sa_date", 
-                fieldLabel : "单据日期", 
+                xtype: "datefield",
+                name: "sa_date",
+                fieldLabel: "单据日期",
                 defaultValue: new Date()
             }, {
-                xtype : "textfield", 
-                name : "sa_currency",
-                fieldLabel : "币别", 
-                readOnly:true,
-                defaultValue:'RMB'
+                xtype: "textfield",
+                name: "sa_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            }, {
+                xtype: "textfield",
+                name: "sa_total",
+                fieldLabel: "销售金额",
+                readOnly: true
+            }, {
+                xtype: "employeeDbfindTrigger",
+                name: "sa_seller",
+                fieldLabel: "业务员"
             }, {
-                xtype : "textfield", 
-                name : "sa_total", 
-                fieldLabel : "销售金额",
-                readOnly:true
-            },{
-                xtype : "employeeDbfindTrigger", 
-                name : "sa_seller", 
-                fieldLabel : "业务员"
-            },{
-                xtype : "hidden", 
-                name : "sa_sellerid", 
-                fieldLabel : "业务员ID"
-            },{
-                xtype : "hidden", 
-                name : "sa_sellercode", 
-                fieldLabel : "业务员编号",
+                xtype: "hidden",
+                name: "sa_sellerid",
+                fieldLabel: "业务员ID"
             }, {
-                xtype : 'textfield', 
-                name : 'sa_sendstatus', 
-                fieldLabel : '出货状态', 
-                hidden : true
-             },{
-                xtype : "hidden", 
-                name : "creatorId", 
-                fieldLabel : "录入人ID", 
-                readOnly:true
-            },
-            {
-                xtype : "textfield", 
-                name : "creatorName", 
-                fieldLabel : "录入人", 
-                readOnly:true
+                xtype: "hidden",
+                name: "sa_sellercode",
+                fieldLabel: "业务员编号",
             }, {
-                xtype : "datefield", 
-                name : "createTime", 
-                fieldLabel : "录入日期",
-                readOnly:true, 
+                xtype: 'textfield',
+                name: 'sa_sendstatus',
+                fieldLabel: '出货状态',
+                hidden: true
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
                 defaultValue: new Date()
-            },{
-                xtype : "hidden", 
-                name : "updaterId", 
-                fieldLabel : "更新人ID", 
-                readOnly:true
-            },{
-                xtype : "hidden", 
-                name : "updaterName", 
-                fieldLabel : "更新人", 
-                readOnly:true
             }, {
-                xtype : "hidden", 
-                name : "updateTime", 
-                fieldLabel : "更新日期",
-                readOnly:true, 
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
                 defaultValue: new Date()
             }, {
-                xtype : "textfield", 
-                name : "sa_auditman", 
-                fieldLabel : "审核人", 
-                readOnly:true
+                xtype: "textfield",
+                name: "sa_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
             }, {
-                xtype : "datefield", 
-                name : "sa_auditdate", 
-                fieldLabel : "审核日期",
-                readOnly:true
+                xtype: "datefield",
+                name: "sa_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
             }]
         });
-       this.callParent();
-     },   
-     toolBtns: [{
-         xtype: 'button',
-         text: '转出货单',
-         hidden: true,
-         handler: 'turnOut',
-         bind: {
-             hidden: '{sa_statuscode!="AUDITED"}'
-         }
-     },{
-         xtype: 'button',
-         text: '转采购单',
-         hidden: true,
-         handler: 'turnPurchase',
-         bind: {
-             hidden: '{sa_statuscode!="AUDITED"}'
-         }
-     }]
+        this.callParent();
+    },
+    toolBtns: [{
+        xtype: 'button',
+        text: '转出货单',
+        hidden: true,
+        handler: 'turnOut',
+        bind: {
+            hidden: '{sa_statuscode!="AUDITED"}'
+        }
+    }, {
+        xtype: 'button',
+        text: '转采购单',
+        hidden: true,
+        handler: 'turnPurchase',
+        bind: {
+            hidden: '{sa_statuscode!="AUDITED"}'
+        }
+    }]
 });

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

@@ -205,7 +205,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '数量',

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

@@ -105,7 +105,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         name : "detailGridField", 
         xtype : "detailGridField", 
         detnoColumn:  'pd_pdno',
-        storeModel:'saas.model.sale.ProdIODetail',
+        storeModel:'saas.model.sale.SaleInDetail',
         deleteDetailUrl:'/api/sale/prodinout/deleteDetail',
         columns : [
             {
@@ -224,8 +224,8 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             },{
                 text : "单价(元)", 
                 xtype: 'numbercolumn',
-                dataIndex : "pd_sendprice", 
-                width : 110.0, 
+                dataIndex : "pd_netprice", 
+                width : 120, 
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 4,
@@ -237,38 +237,52 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     var format = '0,000.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 },
-            },  {
-                text : "仓库ID", 
-                dataIndex : "pd_whid", 
-                width : 0
             }, {
-                text : "仓库", 
-                dataIndex : "pd_whcode", 
-                hidden :true
-            }, {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                allowBlank:false,
-                width : 150.0, 
+                text : "含税单价(元)", 
+                xtype: 'numbercolumn',
+                dataIndex : "pd_sendprice", 
+                width : 120, 
                 editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
+                    xtype : "numberfield",
+                    decimalPrecision: 4,
+                    minValue:0
+                },
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join('');
+                    return Ext.util.Format.number(v, format);
+                },
+                listeners: {
+                    edit: function(value, grid) {
+                        var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_taxrate');
+                        r.set('pd_netprice', value / (1 + pd_taxrate / 100));
+                    }
                 }
-            },
-            {
+            }, {
+                text : "金额", 
+                xtype: 'numbercolumn',
+                dataIndex : "pd_nettotal", 
+                width : 120, 
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join('');
+                    return Ext.util.Format.number(v, format);
+                },
+                summaryType: 'sum',
+                summaryRenderer: function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                    var format = '0,000.' + xr.join('');
+                    return Ext.util.Format.number(v, format);
+                }
+            }, {
                 text : "税率", 
                 xtype: 'numbercolumn',
                 dataIndex : "pd_taxrate", 
-                width : 80.0, 
+                width : 80, 
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 0,
@@ -278,31 +292,29 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 renderer : function(v) {
                     return Ext.util.Format.number(v, '0');
                 },
-            }, 
-           {
-                text : "含税金额", 
+            }, {
+                text: "税额",
                 xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 110.0, 
-                renderer : function(v) {
+                dataIndex: "pd_taxamount",
+                width: 120,
+                renderer: function (v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                     var format = '0,000.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 },
                 summaryType: 'sum',
-                summaryRenderer: function(v) {
+                summaryRenderer: function (v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                     var format = '0,000.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 }
-            },
-            {
-                text : "未税金额", 
+            }, {
+                text : "价税合计", 
                 xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 110.0, 
+                dataIndex : "pd_ordertotal", 
+                width : 120, 
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -316,13 +328,37 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     var format = '0,000.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 }
-            },
-            {
+            }, {
+                text : "仓库ID", 
+                dataIndex : "pd_whid", 
+                width : 0
+            }, {
+                text : "仓库", 
+                dataIndex : "pd_whcode", 
+                hidden :true
+            }, {
+                text : "仓库", 
+                dataIndex : "pd_whname", 
+                allowBlank:false,
+                width : 150.0, 
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "warehouseDbfindTrigger"
+                }
+            }, {
                 text : "销售订单明细id", 
                 dataIndex : "pd_sdid", 
                 hidden:true
-            },
-            {
+            }, {
                 text : "销售单号", 
                 dataIndex : "pd_ordercode", 
                 width : 150.0,

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

@@ -225,7 +225,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '退货数量',

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

@@ -6,24 +6,24 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
     viewModel: 'sale-saleout-formpanel',
 
     viewName: 'sale-saleout-formpanel',
-    caller:'SaleOut',
-    
+    caller: 'SaleOut',
+
     //字段属性
-    _title:'出货单',
+    _title: '出货单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/sale/prodinout/read',
-    _saveUrl:'/api/sale/prodinout/save',
-    _auditUrl:'/api/sale/prodinout/audit',
-    _unAuditUrl:'/api/sale/prodinout/unAudit',
-    _deleteUrl:'/api/sale/prodinout/delete',
-    _turnInUrl:'/api/sale/prodinout/turnProdIn',
-    initId:0,
+    _readUrl: '/api/sale/prodinout/read',
+    _saveUrl: '/api/sale/prodinout/save',
+    _auditUrl: '/api/sale/prodinout/audit',
+    _unAuditUrl: '/api/sale/prodinout/unAudit',
+    _deleteUrl: '/api/sale/prodinout/delete',
+    _turnInUrl: '/api/sale/prodinout/turnProdIn',
+    initId: 0,
 
     toolBtns: [{
         xtype: 'button',
@@ -40,32 +40,33 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         name: 'id',
         fieldLabel: 'id'
     }, {
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : false, 
-        defaultValue:'出货单'
+        xtype: "hidden",
+        name: "pi_class",
+        fieldLabel: "单据类型",
+        readOnly: true,
+        allowBlank: false,
+        defaultValue: '出货单'
     }, {
-        xtype : "hidden", 
-        name : "pi_custid", 
-        fieldLabel : "客户ID"
+        xtype: "hidden",
+        name: "pi_custid",
+        fieldLabel: "客户ID"
     }, {
-        xtype : "hidden", 
-        name : "pi_custcode", 
-        fieldLabel : "客户编号" 
+        xtype: "hidden",
+        name: "pi_custcode",
+        fieldLabel: "客户编号"
     }, {
-        xtype : "customerDbfindTrigger", 
-        name : "pi_custname", 
-        fieldLabel : "客户名称",
-        allowBlank:false,
-        setValue:function(value){
-            var me = this,bind, valueBind;
+        xtype: "customerDbfindTrigger",
+        name: "pi_custname",
+        fieldLabel: "客户名称",
+        allowBlank: false,
+        setValue: function (value) {
+            var me = this,
+                bind, valueBind;
             var form = me.ownerCt;
             var c = form.down('[name=pi_address]');
-            if(value&&value!=''){
+            if (value && value != '') {
                 c.setDisabled(false);
-            }else{
+            } else {
                 c.setDisabled(true);
             }
             if (me.hasFocus) {
@@ -81,11 +82,10 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             } else {
                 me.lastSelectedRecords = null;
             }
-    
+
             if (value != null) {
                 me.doSetValue(value);
-            }
-            else {
+            } else {
                 me.suspendEvent('select');
                 me.valueCollection.beginUpdate();
                 me.pickerSelectionModel.deselectAll();
@@ -95,317 +95,348 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
             return me;
         }
     }, {
-        columnWidth : 0.5,
-        name : "pi_address", 
-        xtype : "remotecombo", 
-        fieldLabel : "交货地址", 
-        editable:false,
-        allowBlank : false, 
-        storeUrl:'/api/document/customer/getAddressCombo',
-        hiddenBtn:true,//true 则会关闭新增按钮功能
+        columnWidth: 0.5,
+        name: "pi_address",
+        xtype: "remotecombo",
+        fieldLabel: "交货地址",
+        editable: false,
+        allowBlank: false,
+        storeUrl: '/api/document/customer/getAddressCombo',
+        hiddenBtn: true, //true 则会关闭新增按钮功能
     }, {
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
+        xtype: "datefield",
+        name: "pi_date",
+        fieldLabel: "单据日期",
+        allowBlank: false,
+        columnWidth: 0.25,
         defaultValue: new Date()
     }, {
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        detnoColumn:  'pd_pdno',
-        storeModel:'saas.model.sale.ProdIODetail',
-        deleteDetailUrl:'/api/sale/prodinout/deleteDetail',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            }, {
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                width : 0
-            }, {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank:false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 150.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 150, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+        name: "detailGridField",
+        xtype: "detailGridField",
+        detnoColumn: 'pd_pdno',
+        storeModel: 'saas.model.sale.SaleOutDetail',
+        deleteDetailUrl: '/api/sale/prodinout/deleteDetail',
+        columns: [{
+            text: "id",
+            dataIndex: "id",
+            xtype: "numbercolumn",
+            hidden: true
+        }, {
+            text: "物料id",
+            dataIndex: "pd_prodid",
+            width: 0
+        }, {
+            text: "物料编号",
+            width: 150.0,
+            dataIndex: "pd_prodcode",
+            xtype: "",
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "productMultiDbfindTrigger"
+            }
+        }, {
+            text: 'model映射需要',
+            dataIndex: 'productDTO',
+            hidden: true,
+        }, {
+            text: "品牌",
+            width: 150.0,
+            dataIndex: "pr_brand",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "出货数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_outqty", 
-                width : 110.0, 
-                allowBlank:false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-                    var format = '0.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+                return v;
+            }
+        }, {
+            text: "名称",
+            width: 200.0,
+            dataIndex: "pr_detail",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
+                return v;
+            }
+        }, {
+            text: "型号",
+            width: 200.0,
+            dataIndex: "pr_orispeccode",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
-            },{
-                text : "单价(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_sendprice", 
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-            },{
-                text : "仓库ID", 
-                dataIndex : "pd_whid", 
-                hidden :true
-            }, {
-                text : "仓库", 
-                dataIndex : "pd_whcode", 
-                hidden :true
-            }, {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                width : 150.0, 
-                items : null,
-                allowBlank:false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
+                return v;
+            }
+        }, {
+            text: "规格",
+            width: 150,
+            dataIndex: "pr_spec",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
+                return v;
+            }
+        }, {
+            text: "出货数量",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_outqty",
+            width: 110.0,
+            allowBlank: false,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 3,
+                minValue: 0
             },
-            {
-                text : "税率", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_taxrate", 
-                width : 80.0, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                }, 
-                renderer : function(v) {
-                    return Ext.util.Format.number(v, '0');
-                }
-            }, 
-           {
-                text : "含税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 150.0, 
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                }
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
             },
-            {
-                text : "未税金额", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 150.0, 
-                renderer : function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join('');
-                    return Ext.util.Format.number(v, format);
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+                var format = '0.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "单位",
+            width: 80.0,
+            dataIndex: "pr_unit",
+            ignore: true,
+            renderer: function (v, m, r) {
+                if (!v) {
+                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
                 }
+                return v;
+            }
+        }, {
+            text: "单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_netprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
+            },
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+        }, {
+            text: "含税单价(元)",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_sendprice",
+            width: 120,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 4,
+                minValue: 0
             },
-            {
-                text : "销售单号", 
-                dataIndex : "pd_ordercode", 
-                width : 150.0,
-                ignore:true
-            },{
-                text : "销售序号", 
-                dataIndex : "pd_orderdetno", 
-                xtype : "numbercolumn",
-                width : 110.0,
-                format: '0',
-                ignore:true,
-                renderer: function(v) {
-                    return v ? v : null;
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            listeners: {
+                edit: function (value, grid) {
+                    var r = grid.getSelection()[0],
+                        pd_taxrate = r.get('pd_netprice');
+                    r.set('pd_netprice', value / (1 + pd_taxrate / 100));
                 }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
             }
-        ]
+        }, {
+            text: "金额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_nettotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "税率",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxrate",
+            width: 80,
+            editor: {
+                xtype: "numberfield",
+                decimalPrecision: 0,
+                minValue: 0,
+                maxValue: 100
+            },
+            renderer: function (v) {
+                return Ext.util.Format.number(v, '0');
+            }
+        }, {
+            text: "税额",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_taxamount",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "价税合计",
+            xtype: 'numbercolumn',
+            dataIndex: "pd_ordertotal",
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: "仓库ID",
+            dataIndex: "pd_whid",
+            hidden: true
+        }, {
+            text: "仓库编号",
+            dataIndex: "pd_whcode",
+            hidden: true
+        }, {
+            text: "仓库",
+            dataIndex: "pd_whname",
+            width: 150.0,
+            items: null,
+            allowBlank: false,
+            editor: {
+                displayField: "display",
+                editable: true,
+                format: "",
+                hideTrigger: false,
+                maxLength: 100.0,
+                minValue: null,
+                positiveNum: false,
+                queryMode: "local",
+                store: null,
+                valueField: "value",
+                xtype: "warehouseDbfindTrigger"
+            }
+        }, {
+            text: "销售单号",
+            dataIndex: "pd_ordercode",
+            width: 150.0,
+            ignore: true
+        }, {
+            text: "销售序号",
+            dataIndex: "pd_orderdetno",
+            xtype: "numbercolumn",
+            width: 110.0,
+            format: '0',
+            ignore: true,
+            renderer: function (v) {
+                return v ? v : null;
+            }
+        }, {
+            text: "备注",
+            dataIndex: "pd_remark",
+            width: 250,
+            items: null,
+            editor: {
+                xtype: "textfield"
+            },
+        }]
+    }, {
+        xtype: "textfield",
+        name: "pi_total",
+        fieldLabel: "单据金额",
+        readOnly: true
     }, {
-        xtype : "textfield", 
-        name : "pi_total", 
-        fieldLabel : "单据金额", 
+        xtype: "textfield",
+        name: "pi_remark",
+        fieldLabel: "备注",
+        columnWidth: 0.75
+    }, {
+        xtype: "hidden",
+        name: "creatorId",
+        fieldLabel: "录入人ID",
         readOnly: true
     }, {
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 0.75
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
-    },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "creatorName",
+        fieldLabel: "录入人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
+        xtype: "datefield",
+        name: "createTime",
+        fieldLabel: "录入日期",
+        readOnly: true,
         defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
     }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
+        xtype: "hidden",
+        name: "updaterId",
+        fieldLabel: "更新人ID",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updaterName",
+        fieldLabel: "更新人",
+        readOnly: true
+    }, {
+        xtype: "hidden",
+        name: "updateTime",
+        fieldLabel: "更新日期",
+        readOnly: true,
         defaultValue: new Date()
     }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
+        xtype: "textfield",
+        name: "pi_auditman",
+        fieldLabel: "审核人",
+        readOnly: true
     }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
+        xtype: "datefield",
+        name: "pi_auditdate",
+        fieldLabel: "审核日期",
+        readOnly: true
     }]
 });

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

@@ -217,7 +217,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '出货数量',

+ 1 - 1
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js

@@ -185,7 +185,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
                 width: 200
             },{
                 text: '规格',
-                dataIndex: 'pr_spce',
+                dataIndex: 'pr_spec',
                 width: 150
             },{
                 text: '数量',

+ 6 - 0
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -67,6 +67,12 @@ Ext.define('saas.view.stock.make.FormPanel', {
         fieldLabel : "产品名称",
         readOnly:true,
         columnWidth: 0.25
+    },{
+        xtype : "textfield", 
+        name : "ma_prodorispec", 
+        fieldLabel : "产品型号",
+        readOnly:true,
+        columnWidth: 0.25,
     },{
         xtype : "textfield", 
         name : "ma_prodspec", 

+ 3 - 0
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -96,6 +96,9 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         }, {
                             from: 'bo_version',
                             to: 'ma_version'
+                        }, {
+                            from: 'pr_orispeccode',
+                            to: 'ma_prodorispec'
                         }],
                         aftertrigger: function (f, record) {
                             me.getBomData(record.data.id)

+ 8 - 0
frontend/saas-web/app/view/stock/make/QueryPanel.js

@@ -127,6 +127,14 @@ Ext.define('saas.view.stock.make.QueryPanel', {
             text: '产品名称',
             dataIndex: 'ma_proddetail',
             width: 200
+        }, {
+            text: '产品型号',
+            dataIndex: 'ma_prodorispec',
+            width: 200
+        }, {
+            text: '产品规格',
+            dataIndex: 'ma_prodspec',
+            width: 200
         }, {
             text: '版本号',
             dataIndex: 'ma_version',

+ 1 - 1
frontend/saas-web/app/view/stock/otherIn/QueryPanel.js

@@ -178,7 +178,7 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '数量',

+ 3 - 3
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -164,19 +164,19 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                 width: 110.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 8,
+                    decimalPrecision: 3,
                     minValue:0
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
+                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
                     var format = '0.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 },
                 summaryType: 'sum',
                 summaryRenderer: function(v) {
                     var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
+                    var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
                     var format = '0.' + xr.join('');
                     return Ext.util.Format.number(v, format);
                 }

+ 1 - 1
frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

@@ -178,7 +178,7 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
             width: 200
         },{
             text: '规格',
-            dataIndex: 'pr_spce',
+            dataIndex: 'pr_spec',
             width: 150
         },{
             text: '数量',