Browse Source

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

hy 7 years ago
parent
commit
cfc0d1459b

+ 1 - 1
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/CustomerServiceTest.java

@@ -44,7 +44,7 @@ public class CustomerServiceTest {
         CustomercontactDTO item = new CustomercontactDTO();
         item.setCc_name("联系人1");
         item.setCc_detno(1);
-        item.setCc_tel(112);
+        item.setCc_tel(112L);
         item.setCc_qq("396996717");
         item.setCc_email("@qq.com");
 

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

@@ -129,7 +129,7 @@ public class ProdInOutController {
      * @param id
      * @return
      */
-    @PostMapping("/deleteItem/{id}")
+    @PostMapping("/deleteDetail/{id}")
     public Result deleteItem(@PathVariable("id") Long id) {
         prodInOutService.deleteItem(id);
         return Result.success();

+ 9 - 8
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java

@@ -401,9 +401,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //插入销售退货单主表
         ProdInOut targetPi = new ProdInOut();
         //生成单号
-        String piInoutno =
-                //BillCodeSeq.SALEIN.getCaller() + Math.abs(Math.random()*100);
-                maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
+        String piInoutno = maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
@@ -564,7 +562,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }else {//销售退货单
             caller = BillCodeSeq.SALEIN.getCaller();
         }
-        return maxnumberService.pushMaxnubmer(count, code, caller).getData();
+        return  maxnumberService.pushMaxnubmer(count, code, caller).getData();
         //return  caller+Math.abs(Math.random()*100);
     }
 
@@ -596,16 +594,19 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             prodIODetailMapper.updatePDSaleOut(id);
             //更新主表
             prodInOutMapper.updatePiTotal(id);
-
             //更新销售已转数
-            prodIODetailMapper.updateSaleYqty(prodInOut.getPi_said());
-        }else{//销售退货单
+            if(prodInOut.getPi_said()!=null) {
+                prodIODetailMapper.updateSaleYqty(prodInOut.getPi_said());
+            }
+        }else{//销售退货单z
             //更新明细
             prodIODetailMapper.updatePDSaleIN(id);
             //更新主表
             prodInOutMapper.updatePiTotal(id);
             //出货单已转数
-            prodIODetailMapper.updateSaleOutYqty(prodInOut.getPi_said());
+            if(prodInOut.getPi_said()!=null){
+                prodIODetailMapper.updateSaleOutYqty(prodInOut.getPi_said());
+            }
         }
     }
 

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

@@ -442,7 +442,6 @@ public class SaleServiceImpl implements SaleService{
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
         long pi_id = prodInOut.getId();
-
         for (int i=0;i<details.size();i++){
             SaleDetail saleDetail =details.get(i);
             ProdIODetail prodIODetail = new ProdIODetail();
@@ -472,11 +471,13 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_sendstatus(Status.TURNOUT.getDisplay());
         sale.setSa_sendstatuscode(Status.TURNOUT.name());
         //更新存在字段
-         saleMapper.updateByPrimaryKeySelective(sale);
-         //日志记录
-         DocBaseDTO baseDTO = new DocBaseDTO(pi_id, pi_inoutno, BillCodeSeq.SALEOUT.getName());
-         //messageLogService.customizeLog(baseDTO, Operation.);
-         return baseDTO;
+        saleMapper.updateByPrimaryKeySelective(sale);
+        prodInOutMapper.updatePiTotal(pi_id);
+        prodIODetailMapper.updatePDSaleOut(pi_id);
+        //日志记录
+        DocBaseDTO baseDTO = new DocBaseDTO(pi_id, pi_inoutno, BillCodeSeq.SALEOUT.getName());
+        //messageLogService.customizeLog(baseDTO, Operation.);
+        return baseDTO;
     }
 
     @Override

+ 4 - 8
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -739,14 +739,10 @@
 
   <update id="updateSaleOutYqty" parameterType="long">
 update prodiodetail a
-  set a.pd_yqty =IFNULL(
-    (
-      select  b.pd_inqty  from
-        (select pd_ioid,sum(pd_inqty) pd_inqty from  prodiodetail  where pd_piclass='销售退货单'
-          and pd_piid=#{id}  GROUP BY pd_ioid ) b
-          where IFNULL(b.pd_ioid ,0)= a.pd_id
-     ),0)
-where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pd_piclass='出货单')
+  set a.pd_yqty =ifnull((select  b.pd_inqty  from  (
+	select pd_ioid,sum(pd_inqty) pd_inqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售退货单'
+  and pi_said=#{id}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+  where a.pd_piid = (select pi_id from prodinout where pi_said=#{id} and pi_class='出货单');
   </update>
   <update id="updateSaleYqty" parameterType="long">
 

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

@@ -54,6 +54,39 @@ Ext.define('saas.view.core.form.FormPanel', {
         me.initViewModel();
         me.FormUtil.setItems(me);
 
+        me.defaultBtns = me.defaultBtns || [{
+            cls: 'x-formpanel-btn-orange',
+            xtype: 'button',
+            text: '新增',
+            bind: {
+                hidden: '{!id}'
+            },
+            handler: 'add'
+        }, {
+            xtype: 'button',
+            text: '保存',
+            handler: 'onSave',
+            bind: {
+                // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
+                disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
+            }
+        }, {
+            xtype: 'button',
+            text: '删除',
+            bind: {
+                hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
+            },
+            handler: 'delete'
+        }, {
+            xtype: 'button',
+            bind: {
+                text: '{auditBtnText}',
+                disabled: '{!base.valid}',
+                hidden:'{!showAuditBtn}'
+            },
+            handler: "auditBtnClick",
+        }];
+
         Ext.apply(me, {
             dockedItems: [{
                 xtype: 'toolbar',
@@ -118,39 +151,6 @@ Ext.define('saas.view.core.form.FormPanel', {
             handler: 'codeEditorClick'
         }, '->'];
         
-        var defaultBtns = [{
-            cls: 'x-formpanel-btn-orange',
-            xtype: 'button',
-            text: '新增',
-            bind: {
-                hidden: '{!id}'
-            },
-            handler: 'add'
-        }, {
-            xtype: 'button',
-            text: '保存',
-            handler: 'onSave',
-            bind: {
-                // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
-                disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
-            }
-        }, {
-            xtype: 'button',
-            text: '删除',
-            bind: {
-                hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
-            },
-            handler: 'delete'
-        }, {
-            xtype: 'button',
-            bind: {
-                text: '{auditBtnText}',
-                disabled: '{!base.valid}',
-                hidden:'{!showAuditBtn}'
-            },
-            handler: "auditBtnClick",
-        }];
-
         if(me.codeInHeader) {
             items = items.concat(codeHeaderItems);
         }
@@ -160,7 +160,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         items = items.concat(me.toolBtns.map(function (btn) {
             btn.cls = btn.cls ? btn.cls + ' x-formpanel-btn-blue' : 'x-formpanel-btn-blue';
             return btn;
-        }).concat(defaultBtns))
+        }).concat(me.defaultBtns))
 
         return items;
     },
@@ -297,6 +297,10 @@ Ext.define('saas.view.core.form.FormPanel', {
     initFormData: function(data) {
         var me = this;
         me.setFormData(data);
+        var fields = me.getForm().getFields().items;
+        Ext.Array.each(fields, function(f) {
+            f.resetOriginalValue ? f.resetOriginalValue() : '';
+        });
     },
 
     /**
@@ -365,5 +369,26 @@ Ext.define('saas.view.core.form.FormPanel', {
                 typeof item.setDisabled == 'function' && item.setDisabled(!able);
             }
         });
-    }
+    },
+
+    //overriders
+    isDirty: function () {
+        var me = this,
+        detailGrids = me.query('detailGridField'),
+        dirty = false;
+
+        for(var i = 0; i < detailGrids.length; i++) {
+            var grid = detailGrids[i];
+            if(grid.isDirty()) {
+                dirty = true;
+                break;
+            }
+        }
+
+        if(!dirty) {
+            dirty = me.callParent();
+        }
+
+        return dirty;
+    },
 });

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

@@ -127,10 +127,6 @@ Ext.define('saas.view.core.form.FormPanelController', {
             return false;
         }
         
-        if(form.getForm().wasDirty==false){
-            showToast('未修改数据,请修改后保存');
-            return false;
-        }
         //form里面数据
         var formData = form.getFormData();
         var params = {

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

@@ -362,6 +362,21 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         return valid;
     },
 
+    isDirty: function() {
+        var me = this,
+        store = me.getStore(),
+        dataItems = store.data.items;
+
+        for(var i = 0; i < dataItems.length; i++) {
+            var item = dataItems[i];
+            if(item.dirty) {
+                return true;
+            }
+        }
+
+        return false;
+    },
+
     /**
      * 获得所有数据
      */

+ 41 - 3
frontend/saas-web/app/view/core/tab/Controller.js

@@ -16,13 +16,51 @@ Ext.define('saas.view.core.tab.Controller', {
         tab.tabView = tab.add(view);
     },
 
-    onTabChange: function() {
+    onTabChange: function(component) {
         var me = this,
-        tab = me.getView(),
-        tabView = tab.tabView;
+        tabPanel = me.getView(),
+        tabView = tabPanel.tabView;
 
         if(typeof tabView.refresh == 'function') {
             tabView.refresh();
         }
+
+        if(!component.resetCloseClick) {
+            component.tab.onCloseClick = function() {
+                var me = this;
+         
+                if (me.fireEvent('beforeclose', me) !== false) {
+                    if (me.tabBar) {
+                        if(typeof tabView.isDirty == 'function' && tabView.isDirty()) {
+                            showConfirm('提示', '表单数据有修改,确定要退出吗?')
+                            .then(function(yes) {
+                                if(yes == 'yes') {
+                                    if (me.tabBar.closeTab(me) === false) {
+                                        return;
+                                    }
+                                }
+                            });
+                        }else {
+                            if (me.tabBar.closeTab(me) === false) {
+                                return;
+                            }
+                        }
+                    } else {
+                        if(typeof tabView.isDirty == 'function' && tabView.isDirty()) {
+                            showConfirm('提示', '表单数据有修改,确定要退出吗?')
+                            .then(function(yes) {
+                                if(yes == 'yes') {
+                                    me.fireClose();
+                                }
+                            });
+                        }else {
+                            me.fireClose();
+                        }
+                    }
+                }
+            }
+
+            component.resetCloseClick = true;
+        }
     }
 });

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

@@ -30,7 +30,7 @@ Ext.define('saas.view.main.MainContainerWrap', {
                 margin: 10
             },
             plugins: [new Ext.ux.TabCloseMenu({
-                closeTabText: '关闭',
+                closeTabText: '关闭当前页',
                 closeAllTabsText: '关闭全部',
                 closeOthersTabsText: '关闭其他'
             })],

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

@@ -142,6 +142,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         }, {
             text: "单据日期",
             dataIndex: "pbd_sldate",
+            xtype: 'datecolumn',
             defaultValue: new Date()
         }, {
             text: "单据金额",

+ 59 - 19
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -5,56 +5,96 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
     init: function (form) {
         var me = this;
         this.control({
-            'dbfindtrigger[name=rb_custname]':{
+            // 供应商名称
+            'dbfindtrigger[name=pb_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        //数据接口
-                        dataUrl: '/api/document/customer/list',
-                        addXtype: 'document-customer-formpanel',
-                        addTitle: '客户资料',
+                        dataUrl:'/api/document/vendor/list',
+                        addXtype: 'document-vendor-formpanel',
+                        addTitle: '供应商资料',
+                        defaultCondition:"ve_statuscode='OPEN'",
                         //赋值 
                         dbfinds:[{
-                            from: 'id', to: 'rb_custid'
-                        }, {
-                            from:'cu_code', to:'rb_custcode'
+                            from:'ve_code',to:'pd_vendcode'
                         },{
-                            from:'cu_name', to:'rb_custname'
+                            from:'ve_name',to:'pb_vendname'
                         }],
                         //联想设置
                         dbtpls:[{
-                            field:'cu_code',width:100
+                            field:'ve_code',width:100
                         },{
-                            field:'cu_name',width:100
+                            field:'ve_name',width:100
                         }],
                         //联想查询条件
-                        dbCondition:"CONCAT(cu_code, cu_name) like '{0}%'",
+                        dbtplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 
-                            name : "cu_name", 
-                            conditionExpression:"cu_name like '{0}%'",//传入后台条件  替换占位符
-                            fieldLabel : "客户名称", 
+                            name : "ve_name", 
+                            fieldLabel : "供应商名称", 
                             columnWidth : 0.25
                         }],
                         //放大镜窗口列表
                         dbColumns:[{
-                            "text": "ID",
+                            "text": "供应商ID",
                             "flex": 0,
-                            "dataIndex": "id",
+                            "dataIndex": "ve_id",
                             "width": 0,
                             "xtype": "",
                             "items": null
                         },{
                             "text": "供应商编号",
                             "flex": 1,
-                            "dataIndex": "cu_code",
+                            "dataIndex": "ve_code",
                             "width": 100,
                             "xtype": "",
                             "items": null
                         }, {
                             "text": "供应商名称",
                             "flex": 1,
-                            "dataIndex": "cu_name",
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "税率",
+                            "flex": 0,
+                            "dataIndex": "ve_taxrate",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "承付天数",
+                            "flex": 0,
+                            "dataIndex": "ve_promisedays",
+                            "width": 50,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "纳税人识别号",
+                            "flex": 0,
+                            "dataIndex": "ve_nsrzh",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "开户银行",
+                            "flex": 0,
+                            "dataIndex": "ve_bankcode",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "银行账户",
+                            "flex": 0,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 200,
                             "xtype": "",
                             "items": null
                         }]

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

@@ -70,7 +70,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         addTitle:'销售退货单',
         addXtype:'sale-salein-formpanel',
         defaultCondition:' pi_class = \'销售退货单\'',
-        baseVastUrl: 'http://192.168.253.48:8820/prodinout/',
+        baseVastUrl: '/api/sale/prodinout/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',

+ 8 - 0
frontend/saas-web/overrides/i18n.js

@@ -60,6 +60,14 @@ function getCurrentTab() {
     return currentTab;
 }
 
+function showConfirm(title, message) {
+    return new Ext.Promise(function (resolve, reject) {
+        Ext.MessageBox.confirm(title, message, function(buttonId) {
+            return resolve(buttonId);
+        });
+    })
+}
+
 function warnMsg(msg, fn){
 	Ext.MessageBox.show({
      	title: '提示',