Browse Source

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

guq 7 years ago
parent
commit
99ab1c388b

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

@@ -384,9 +384,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         me.editable = able;
 
         Ext.Array.each(columns, function(c) {
-            var e = c.getEditor();
-            if(e) {
-                typeof e.setDisabled == 'function' && e.setDisabled(!able);
+            if(typeof c.getEditor != 'undefined'){
+                var e = c.getEditor();
+                if(e) {
+                    typeof e.setDisabled == 'function' && e.setDisabled(!able);
+                }
             }
         });
     },

+ 52 - 0
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -294,4 +294,56 @@ Ext.define('saas.view.money.verification.FormPanelController', {
 
         me.save();
     },
+
+    save:function(){
+        var me = this,
+        form = this.getView(),
+        detailCount = form.detailCount,
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData();
+
+        //form里面数据
+        var formData = form.getDirtyData();
+
+        var params = {
+            main:formData.main
+        };
+
+        for(var i = 0; i < detailCount; i++) {
+            params['items' + ( i + 1)] = formData['detail' + i];
+        }
+
+        // // 只有一个从表时从表字段改为items
+        // if(detailCount == 1) {
+        //     params.items = params.items1;
+        //     delete params.items1;
+        // }
+
+        saas.util.BaseUtil.request({
+            url: form._saveUrl,
+            params: JSON.stringify(params),
+            method: 'POST',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                var id = localJson.data.id;
+                var code = localJson.data.code;
+                form.initId = id;
+                saas.util.FormUtil.loadData(form);
+                saas.util.BaseUtil.showSuccessToast('保存成功');
+
+                var newId = form.xtype + '-' + id;
+                var newTitle = form._title + '(' + code + ')';
+
+                saas.util.BaseUtil.refreshTabTitle(newId, newTitle);
+
+                form.fireEvent('aftersave', true, form, localJson);
+            }
+        })
+        .catch(function(res) {
+            console.error(res);
+            saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
+            form.fireEvent('aftersave', false, form, res);
+        });
+    }
 });

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

@@ -19,9 +19,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         emptyText:'请输入单号或物料',
         showDetail: true,
         getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
+            if(value != '') {
                 return  ' (pi_inoutno like\'%' + value + '%\' or pd_prodcode like \'%'+value+'%\' ) ';
             }
         }
@@ -38,6 +36,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         allowBlank: true,
         editable:false,
         columnWidth: 0.25,
+        showDetail: true,
         queryMode: 'local',
         emptyText :'全部',
         editable:false,
@@ -59,15 +58,13 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             }
         }
     },{
-        xtype: 'textfield',
+        xtype: 'warehouseDbfindTrigger',
         name: 'pd_whcode',
         fieldLabel: '仓库',
         emptyText :'请输入仓库名或仓库编号',
         showDetail: true,
         getCondition: function(value) {
-            if(value == 'ALL') {
-                return '1=1';
-            }else {
+            if(value != '') {
                 return  ' (pd_whcode like\'%' + value + '%\' or pd_whname like \'%'+value+'%\' or pd_inwhcode like\'%' + value + '%\' or pd_inwhname like \'%'+value+'%\') ';
             }
         }
@@ -102,14 +99,6 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             text: '状态',
             dataIndex: 'pi_status',
             width: 90
-        },{
-            text: '供应商名称',
-            dataIndex: 'pi_vendname',
-            width: 0
-        },{
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 0
         },{
             text: '录入人',
             dataIndex: 'creatorName',
@@ -123,48 +112,96 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             dataIndex: 'pi_remark',
             width: 250
         }],
-        relativeColumn: [{
-            text: 'id',
-            dataIndex: 'id',
-            hidden:true,
-            xtype: 'numbercolumn'
-        }, {
-            text: '调拨单号',
-            dataIndex: 'pi_inoutno',
-            width: 150
-        },{
-            text: '单据类型',
-            dataIndex: 'pi_class',
-            width: 0
-        },{
-            text: '单据日期',
-            dataIndex: 'pi_date',
-            xtype:'datecolumn',
-            width: 110
-        },{
-            text: '状态',
-            dataIndex: 'pi_status',
-            width: 90
-        },{
-            text: '供应商名称',
-            dataIndex: 'pi_vendname',
-            width: 0
-        },{
-            text: '客户名称',
-            dataIndex: 'pi_custname',
-            width: 0
-        },{
-            text: '录入人',
-            dataIndex: 'creatorName',
-            width: 110
-        },{
-            text: '审核人',
-            dataIndex: 'pi_auditman',
-            width: 110
-        },{
-            text: '备注',
-            dataIndex: 'pi_remark',
-            width: 250
-        }]
+        relativeColumn: [
+            {
+                text: 'id',
+                dataIndex: 'pi_id',
+                xtype: 'numbercolumn',
+                hidden:true
+            },{
+                text: '调拨单号',
+                dataIndex: 'pi_inoutno',
+                width: 150
+            },{
+                text: '单据类型',
+                dataIndex: 'pi_class',
+                width: 0
+            },{
+                text: '单据日期',
+                dataIndex: 'pi_date',
+                xtype:'datecolumn',
+                width: 110
+            },{
+                text: '状态',
+                dataIndex: 'pi_status',
+                width: 90
+            },{
+                text: '序号',
+                dataIndex: 'pd_pdno',
+                width: 80
+            },{
+                text: '相关单号',
+                dataIndex: 'pd_ordercode',
+                width: 150
+            },{
+                text: '物料编号',
+                dataIndex: 'pd_prodcode',
+                width: 150
+            },{
+                text: '物料名称',
+                dataIndex: 'pr_detail',
+                width: 200
+            },{
+                text: '物料规格',
+                dataIndex: 'pr_spec',
+                width: 150
+            },{
+                text: '单位',
+                dataIndex: 'pr_unit',
+                width: 80
+            },{
+                text: '数量',
+                dataIndex: 'pd_inqty',
+                xtype:'numbercolumn',
+                width: 10
+            },{
+                text: '仓库',
+                dataIndex: 'pd_whname',
+                width: 150
+            },{
+                text: '单价',
+                dataIndex: 'pd_orderprice',
+                xtype:'numbercolumn',
+                width: 110,
+                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);
+                }         
+            },{
+                text: '税率',
+                dataIndex: 'pd_taxrate',
+                xtype:'numbercolumn',
+                width: 80,            
+                renderer : function(v) {
+                    return Ext.util.Format.number(v, '0');
+                },
+            },{
+                text: '金额',
+                dataIndex: 'pd_total',
+                xtype:'numbercolumn',            
+                width: 110,
+                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);
+                }
+            },{
+                text: '备注',
+                dataIndex: 'pd_remark',
+                width:250
+            }]
     }
 });

+ 13 - 0
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js

@@ -5,6 +5,19 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
     init: function (form) {
         var me = this;
         this.control({
+             //放大镜赋值关系 以及 tpl模板
+            'warehouseDbfindTrigger[name=pd_whcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dbfinds:[{
+                            from:'wh_code',to:'pd_whcode'                          
+                        },{
+                            from:'wh_description',to:'pd_whname'
+                        }],
+                    }) ;   
+
+                }
+            }
         });
 
     }

+ 7 - 1
frontend/saas-web/app/view/stock/inventory/EditDataList.js

@@ -223,7 +223,13 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
         text : "盘盈盘亏", 
         dataIndex : "st_num", 
         width : 110.0, 
-        xtype : "numbercolumn", 
+        xtype : "numbercolumn",
+        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);
+        }  
     }],
 
     condition:'',