Browse Source

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

# Conflicts:
#	applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
heqinwei 7 years ago
parent
commit
6740a8df3e
38 changed files with 197 additions and 136 deletions
  1. 1 0
      README.md
  2. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  3. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  4. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  5. 4 6
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  6. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  7. 2 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  8. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java
  9. 1 1
      applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml
  10. 5 0
      base-servers/auth/auth-common/pom.xml
  11. 17 0
      base-servers/auth/auth-common/src/test/java/com/usoftchina/saas/auth/common/jwt/JwtHelperTest.java
  12. BIN
      base-servers/auth/auth-common/src/test/resources/pub.key
  13. 8 0
      base-servers/zipkin-server/src/main/resources/config/application-docker-prod.yml
  14. 1 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  15. 11 0
      frontend/saas-web/app/view/core/form/FormPanelController.js
  16. 13 14
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  17. 6 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  18. 1 1
      frontend/saas-web/app/view/core/query/QueryPanel.js
  19. 16 0
      frontend/saas-web/app/view/core/report/ReportPanel.js
  20. 16 4
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  21. 1 1
      frontend/saas-web/app/view/document/customer/FormPanel.js
  22. 6 6
      frontend/saas-web/app/view/home/InfoCard.js
  23. 1 0
      frontend/saas-web/app/view/home/InfoCard.scss
  24. 10 2
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  25. 5 0
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  26. 6 1
      frontend/saas-web/app/view/money/report/VendorCheck.js
  27. 21 9
      frontend/saas-web/app/view/money/verification/FormPanel.js
  28. 2 1
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  29. 2 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  30. 9 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  31. 2 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  32. 9 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  33. 4 0
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  34. 2 0
      frontend/saas-web/app/view/stock/make/FormPanel.js
  35. 2 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  36. 1 41
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  37. 2 1
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  38. 1 41
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

+ 1 - 0
README.md

@@ -160,6 +160,7 @@
 | --------   | :----:  | :----: | :------:  | :------:  |
 | 10.10.100.103 |  centos  | mykey.key |  CentOS6, RabbitMQ  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.123 |  centos  | mykey.key |  CentOS6, MongoDB  | Cpu: 8, Mem: 8G, Disk: 60G |
+| 10.10.100.127 |  centos  | mykey.key |  CentOS6, Nginx  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.160 |  centos  | mykey.key |  CentOS6, ELK  | Cpu: 8, Mem: 8G, Disk: 60G |
 | 10.10.100.173 |  centos  | mykey.key |  CentOS6, Redis  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.23 |  root  | 62cddbcc624b1b072d84117cc0e5a4db |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |

+ 1 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -87,7 +87,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
     CHECK_SETACOUNT_EXIS(74006, "不能删除单据日期小于等于结账期间<u>%s</u>的单据"),
     VERIFICATION_CHECK_BALANCE(74007,"保存失败,本次核销金额不相等!"),
-    DELETE_NOT_EXIS(74008,"当前单据不存在!"),
+    DELETE_NOT_EXIS(74008,"删除失败,当前单据不存在!"),
     DOCUMENTS_AUDITED(74009,"存在已审核单据:%S"),
     DOCUMENTS_UNAUDITED(74010,"存在未审核单据:%S"),
     BANK_AMOUNT_NOTENOUGHS(74011, "资金账号不足:%S"),

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

@@ -262,7 +262,7 @@
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.vc_text1,jdbcType=VARCHAR}, #{item.vc_text2,jdbcType=VARCHAR},
       #{item.vc_text3,jdbcType=VARCHAR}, #{item.vc_text4,jdbcType=VARCHAR}, #{item.vc_text5,jdbcType=VARCHAR},
       #{item.vc_default,jdbcType=VARCHAR},
-      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -36,4 +36,6 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer validateVendor(@Param("id") Long id);
 
     Integer validateProduct(@Param("id") Long id);
+
+    void updateDelivery(@Param("id")Long id);
 }

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

@@ -15,7 +15,6 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
@@ -51,8 +50,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Autowired
     private PurchaseListMapper purchaseListMapper;
     @Autowired
-    private ProductApi productApi;
-    @Autowired
     private MaxnumberService maxnumberService;
     @Autowired
     private ProdInOutMapper prodInOutMapper;
@@ -143,7 +140,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
                 detail.setPd_yqty(new Double(0));
-                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
                 detail.setCompanyId(companyId);
                 detail.setCreatorId(userId);
                 detail.setCreateTime(new Date());
@@ -169,7 +166,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
-            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
             detail.setUpdaterId(userId);
             detail.setUpdateTime(new Date());
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
@@ -190,7 +187,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purchasedetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(pu_id);
-
+        //明细需求日期为空时==主表交货日期
+        getMapper().updateDelivery(pu_id);
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -439,6 +439,9 @@
     select count(1) from purchasedetail left join product on PD_PRODID=pr_id where  pd_puid=#{id} and pr_statuscode='CLOSE';
   </select>
 
+  <update id="updateDelivery" parameterType="long">
+    update purchasedetail set PD_DELIVERY = (select PU_DELIVERY from purchase where pu_id=#{id}) where pd_puid=#{id} and PD_DELIVERY is null
+  </update>
 
 
 </mapper>

+ 2 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -69,6 +69,8 @@
     <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
 
 

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

@@ -166,4 +166,6 @@ public class ProdInOutList extends CommonBaseEntity{
     private String pr_text2;
     private String pr_text3;
     private String pr_text4;
+    private String pi_prstatus;
+    private String pi_prstatuscode;
 }

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml

@@ -263,7 +263,7 @@
 
   <select id="checkUnPostStockProfit" resultType="int">
     select
-    count(*)
+    count(a.st_prodid)
     from
     (select pd_prodid,pd_whid from prodiodetail left join prodinout on pd_piid = pi_id
     where prodinout.companyId=#{companyId,jdbcType=INTEGER} and (pi_remark='盘盈单' or pi_remark='盘亏单')) b

+ 5 - 0
base-servers/auth/auth-common/pom.xml

@@ -44,6 +44,11 @@
             <scope>compile</scope>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 17 - 0
base-servers/auth/auth-common/src/test/java/com/usoftchina/saas/auth/common/jwt/JwtHelperTest.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.auth.common.jwt;
+
+import static org.junit.Assert.*;
+
+public class JwtHelperTest {
+    @org.junit.Test
+    public void generateToken() throws Exception {
+    }
+
+    @org.junit.Test
+    public void getInfoFromToken() throws Exception {
+        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWx5IiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjQzLCJjb21wYW55SWQiOjEsInVzZXJOYW1lIjoic3VseSIsInJlYWxOYW1lIjoi6IuP54G16LCjIiwiZXhwIjoxNTQzNDExNzY0fQ.KMZV5H4tH4ifYBmY7rV4HSsW1fZHU2k-Yl47b9C3bt6S1_BqzTO-RbVDNMR-WXHpHFwXiq0aoHbqaA512z_-icLPcmeCb2TmnERisgjhnqn7OYordtAWahNlZfiaExnnttLvcNHQSiOWK9vYxxHnf2gC34XdKI0Bo8QZRSR3eo8";
+        String keyPath = "pub.key";
+        JwtInfo info = JwtHelper.getInfoFromToken(token, keyPath);
+    }
+
+}

BIN
base-servers/auth/auth-common/src/test/resources/pub.key


+ 8 - 0
base-servers/zipkin-server/src/main/resources/config/application-docker-prod.yml

@@ -9,5 +9,13 @@ zipkin:
   collector:
     rabbitmq:
       uri: amqp://saas:select123***@10.10.100.103:5672/docker
+  storage:
+    type: elasticsearch
+    elasticsearch:
+      hosts: 10.10.100.160:9200
+      index: zipkin
+      index-shards: 5
+      index-replicas: 1
+      max-requests: 64
 logging:
   destination: 10.10.100.160:5000

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

@@ -438,7 +438,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     isValid: function() {
         var me = this;
         var viewModel = me.getViewModel();
-        var formItems = me.formItems;
+        var formItems = me.formItems || [];
         var valid = !Ext.Array.findBy(formItems, function(f) {
             return !f.isValid();
         });

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

@@ -62,6 +62,17 @@ Ext.define('saas.view.core.form.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
+
+
 
         for(var k in main) {
             // 主表日期改为当前日期

+ 13 - 14
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -81,20 +81,19 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
             }
         },
         beforerender: function(form) {
-            // var fiels = form.getForm().getFields();
-            // fiels.each(function(f) {
-            //     console.log(f, f.on);
-            //     f.on && f.on({
-            //         keydown: {
-            //             // fn: 'onQuery',
-            //             fn: function(th, e, eOpts) {
-            //                 if(e.keyCode == 13) {
-            //                     form.up('core-query-querypanel').getController().onQuery()
-            //                 }
-            //             }
-            //         }
-            //     });
-            // });
+            var fiels = form.getForm().getFields();
+            fiels.each(function(f) {
+                f.enableKeyEvents = true;
+                f.on && f.on({
+                    keydown: {
+                        fn: function(th, e, eOpts) {
+                            if(e.keyCode == 13) {
+                                form.up('core-query-querypanel').getController().onQuery()
+                            }
+                        }
+                    }
+                });
+            });
         }
     }
 

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

@@ -166,7 +166,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
-                hidden: !me.showtool,
+                hidden: me.simpleMode,
                 defaults: { // defaults 将会应用所有的子组件上,而不是父容器
                     listeners: {
                         'mouseover':function(){
@@ -270,6 +270,11 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         me.callParent(arguments);
     },
     listeners: {
+        afterrender: function(grid) {
+            if(grid.simpleMode) {
+                grid.headerCt.child('gridcolumn[isCheckerHd]').hide();
+            }
+        },
         boxready: function(grid, width, height, eOpts) {
             var store = grid.getStore(),
             gridBodyBox = grid.body.dom.getBoundingClientRect(),

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

@@ -129,7 +129,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         me.queryGridConfig['columns']=columns;
-        me.queryGridConfig['showtool'] = !me.simpleMode;
+        me.queryGridConfig['simpleMode'] = me.simpleMode;
         Ext.apply(queryGrid,me.queryGridConfig);
     },
 

+ 16 - 0
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -390,6 +390,22 @@ Ext.define('saas.view.core.report.ReportPanel', {
             if(defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
+
+            item.enableKeyEvents = true;
+            item.listeners = item.listeners || {};
+            Ext.applyIf(item.listeners, {
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            if(!th.fireEvent('beforequery', th)) {
+                                return;
+                            }else {
+                                me.getController().onQuery()
+                            }
+                        }
+                    }
+                }
+            });
         });
 
         return items;

+ 16 - 4
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -45,9 +45,21 @@ Ext.define('saas.view.core.report.ReportPanelController', {
         });
     },
     printHtml: function(html){
-        var d = window.open("", "print");
-        d.document.write(html);
-        d.document.close();
-        d.print();
+        var iframe=document.getElementById("saas-print-iframe");
+        if(!iframe){
+            iframe = document.createElement('IFRAME');
+            var doc = null;
+            iframe.setAttribute("id", "saas-print-iframe");
+            iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
+            document.body.appendChild(iframe);
+            doc = iframe.contentWindow.document;
+            doc.write(html);
+            doc.close();
+            iframe.contentWindow.focus();
+        }
+        iframe.contentWindow.print();
+        if (navigator.userAgent.indexOf("MSIE") > 0){
+            document.body.removeChild(iframe);
+        }
     },
 });

+ 1 - 1
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -159,7 +159,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name : "cu_sellername", 
         fieldLabel : "业务员", 
         editable:false,
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25
     },{
         xtype : "hidden", 

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

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

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

@@ -31,6 +31,7 @@ $max-card-width: 235px;
                         }
 
                         h3 {
+                            text-align: center;
                             font-size: 16px;
                         }
             

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

@@ -67,7 +67,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                 }],
                 series: [{
                     type: 'line',
-                    smooth: true,
+                    // smooth: true,
                     title: '销售额',
                     xField: 'x',
                     yField: 'sale',
@@ -100,7 +100,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                     // renderer: me.onSeriesRenderer
                 }, {
                     type: 'line',
-                    smooth: true,
+                    // smooth: true,
                     title: '销售回款',
                     xField: 'x',
                     yField: 'saleback',
@@ -131,6 +131,14 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                         fillOpacity: 0.1,
                     },
                 }],
+                legend: {
+                    type: 'dom',
+                    docked: 'top',
+                    padding: 0,
+                    bodyPadding: 0,
+                    border: 0,
+                    cls: 'x-monthio-legend'
+                },
                 listeners: {
                     itemhighlightchange: me.itemhighlightchange
                 }

+ 5 - 0
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -20,6 +20,11 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         fieldLabel: '客户名称',
         columnWidth: 0.2,
         allowBlank: false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',

+ 6 - 1
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -19,7 +19,12 @@ Ext.define('saas.view.money.report.VendorCheck', {
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
         columnWidth: 0.2,
-        allowBlank:false
+        allowBlank:false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',

+ 21 - 9
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -590,18 +590,30 @@ Ext.define('saas.view.money.verification.FormPanel', {
         },
 
         defaultConditions: {
-            receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
+            receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
-            prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
+                ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')'],
-            receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0',
-                'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
             receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
-            payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')']
+            ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+            ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))']
         }
     },
 

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

@@ -14,8 +14,9 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _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',

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

@@ -14,7 +14,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/purchase/prodinout/read',
     _saveUrl:'/api/purchase/prodinout/save',

+ 9 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -110,6 +110,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
 
         for(var k in main) {
             // 主表日期改为当前日期

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

@@ -14,7 +14,8 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/purchase/prodinout/read',
     _saveUrl:'/api/purchase/prodinout/save',

+ 9 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -112,6 +112,15 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
 
         for(var k in main) {
             // 主表日期改为当前日期

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

@@ -172,6 +172,10 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             text: '物料编号',
             dataIndex: 'pd_prodcode',
             width: 150
+        }, {
+            text: '物料名称',
+            dataIndex: 'pr_detail',
+            width: 150
         }, {
             text: '出货数量',
             dataIndex: 'pd_outqty',

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

@@ -14,6 +14,8 @@ Ext.define('saas.view.stock.make.FormPanel', {
      _codeField: 'ma_code',
      _statusField: 'ma_status',
      _statusCodeField: 'ma_statuscode',
+     _auditmanField: 'ma_auditman',
+     _auditdateField:'ma_auditdate',
      _relationColumn: 'mm_maid',
 
      _readUrl:'/api/storage/make/read',

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

@@ -15,7 +15,8 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/storage/prodinout/read',
     _saveUrl:'/api/storage/prodinout/save',

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

@@ -82,45 +82,5 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                 },
             },
         });
-    },
-    initCopyData: function(formData) {
-        var me = this;
-        var form = this.getView();
-        var detailCount = form.detailCount;
-        var main = formData.main;
-        var auditTexts = form.auditTexts;
-
-        // 单号、id清空
-        main[form._idField] = 0;
-        main[form._codeField] = '';
-
-        // 单据状态为录入状态(未审核)
-        main[form._statusCodeField] = auditTexts.unAuditCode;
-        main[form._statusField] = auditTexts.unAuditText;
-        main['pi_auditman'] = '';
-        main['pi_auditdate'] = null;
-        for(var k in main) {
-            // 主表日期改为当前日期
-            if(saas.util.BaseUtil.isDateString(main[k])) {
-                main[k] = Ext.Date.format(new Date, 'Y-m-d H:i:s');
-            }
-        }
-
-        for(var j = 0; j < detailCount; j++) {
-            var detail = formData['detail' + j];
-            for(var x = 0; x < detail.length; x ++) {
-                var d = detail[x];
-
-                for(var k in d) {
-                    // 从表id清空
-                    delete d['id'];
-                    // 从表日期清空
-                    if(saas.util.BaseUtil.isDateString(d[k])) {
-                        d[k] = '';
-                    }
-                }
-            }
-        }
-        return me.myInitCopyData(formData);;
-    }    
+    }
 });

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

@@ -14,7 +14,8 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl: '/api/storage/prodinout/read',
     _saveUrl: '/api/storage/prodinout/save',

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

@@ -103,45 +103,5 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
             renderTo: this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    },
-    initCopyData: function(formData) {
-        var me = this;
-        var form = this.getView();
-        var detailCount = form.detailCount;
-        var main = formData.main;
-        var auditTexts = form.auditTexts;
-
-        // 单号、id清空
-        main[form._idField] = 0;
-        main[form._codeField] = '';
-
-        // 单据状态为录入状态(未审核)
-        main[form._statusCodeField] = auditTexts.unAuditCode;
-        main[form._statusField] = auditTexts.unAuditText;
-        main['pi_auditman'] = '';
-        main['pi_auditdate'] = null;
-        for(var k in main) {
-            // 主表日期改为当前日期
-            if(saas.util.BaseUtil.isDateString(main[k])) {
-                main[k] = Ext.Date.format(new Date, 'Y-m-d H:i:s');
-            }
-        }
-
-        for(var j = 0; j < detailCount; j++) {
-            var detail = formData['detail' + j];
-            for(var x = 0; x < detail.length; x ++) {
-                var d = detail[x];
-
-                for(var k in d) {
-                    // 从表id清空
-                    delete d['id'];
-                    // 从表日期清空
-                    if(saas.util.BaseUtil.isDateString(d[k])) {
-                        d[k] = '';
-                    }
-                }
-            }
-        }
-        return me.myInitCopyData(formData);;
-    }     
+    }
 });