瀏覽代碼

代码提交

hy 7 年之前
父節點
當前提交
c275aafca0

+ 5 - 0
frontend/saas-web/app/util/FormUtil.js

@@ -64,6 +64,11 @@ Ext.define('saas.util.FormUtil', {
                                 Ext.applyIf(c, {
                                     lockable: false
                                 });
+
+                                //必填
+                                if(c.logic=='necessaryField'){
+                                    c.cls = 'x-grid-necessary';
+                                }
                                 
                                 var editor = c.editor;
                                 if(editor && editor.xtype == 'numberfield') {

+ 1 - 1
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -153,11 +153,11 @@ Ext.define('saas.view.core.base.GridPanel', {
                 })
                 .then(function() {
                     showToast('操作成功');
+                    grid.store.load();
                 })
                 .catch(function(response) {
                     showToast('操作失败');
                 });
-                grid.store.load();
         }else{
             showToast('请勾选至少一条明细。');
         }

+ 6 - 1
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -62,7 +62,12 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                         }
                     },'->',{
                         xtype:'button',
-                        text:'新增'
+                        text:'新增',
+                        handler:function(b){
+                            var grid = me;
+                            var trigger = grid.ownerCt.trigger;
+                            openTab(trigger.addXtype, '新增'+trigger.addTitle,trigger.addXtype + '_add');
+                        }
                     }])
                 },{
                     xtype: 'pagingtoolbar',

+ 12 - 2
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -30,7 +30,6 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     		var sfield='';
             var dbfinds=me.dbfinds;
             var dbtpls=me.dbtpls;
-            var dbCondition = me.dbCondition.replace(new RegExp("\\{0}","g"), queryString);
     		me.lastQueryValue=queryString;
             if(queryString.trim()==''){
                 me.collapse( );
@@ -72,10 +71,21 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 }
                 //加载数据
                 var data;
+                var dbCondition = [{
+                    type:'string',
+                    field:this.dbtplfield,
+                    operation:'like',
+                    value:queryString
+                }];
                 Ext.Ajax.request({
                     url: me.dataUrl,
                     params: {
-                        keyword:dbCondition
+                        number: 1,
+                        size: 10,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
                     },
                     method: 'GET',
                     success: function(response, opts) {

+ 6 - 1
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -90,7 +90,12 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                         }
                     },'->',{
                         xtype:'button',
-                        text:'新增'
+                        text:'新增',
+                        handler:function(b){
+                            var grid = me;
+                            var trigger = grid.ownerCt.trigger;
+                            openTab(trigger.addXtype, '新增'+trigger.addTitle,trigger.addXtype + '_add');
+                        }
                     },{
                         xtype:'button',
                         text:'确定',

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

@@ -149,7 +149,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
-        _deleteDetailUrl:basePath+'ducument/customer/deletecontact/',
+        deleteDetailUrl:basePath+'ducument/customer/deletecontact/',
         columns : [
             {
                 text : "ID", 
@@ -240,7 +240,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
-        _deleteDetailUrl:basePath+'ducument/customer/deleteaddress/',
+        deleteDetailUrl:basePath+'ducument/customer/deleteaddress/',
         columns : [
             {
                 text : "ID", 
@@ -336,9 +336,9 @@ Ext.define('saas.view.document.customer.FormPanel', {
         statusCodeField = me._statusCodeField,
         viewModel = me.getViewModel();
         
-        viewModel.set('form.' + codeField, '--------------');
-        viewModel.set('form.createTime', new Date());
-        viewModel.set('form.updateTime', new Date());
+        viewModel.set(codeField, '');
+        viewModel.set('createTime', new Date());
+        viewModel.set('updateTime', new Date());
 
         if(statusCodeField) {
             var o = {};

+ 10 - 1
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -110,6 +110,9 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         },
         storeinformation:{
             items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
                 xtype:'textfield',
                 fieldLabel: '仓库编号',
                 name: 'wh_code'
@@ -121,7 +124,13 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 readOnly:true,
                 xtype:'textfield',
                 fieldLabel: '仓库状态',
-                name: 'wh_status'
+                name: 'wh_status',
+                value:'已开启'
+            },{
+                xtype:'hidden',
+                fieldLabel: '仓库状态码',
+                name: 'wh_statuscode',
+                value:'OPEN'
             }]
         }
     },

+ 47 - 2
frontend/saas-web/app/view/document/kind/Kind.js

@@ -6,6 +6,9 @@ Ext.define('saas.view.document.kind.Kind', {
     xtype: 'document-kind',
     autoScroll: true,
     layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     controller:'document-kind',
     viewModel: {
         type: 'document-kind'
@@ -151,9 +154,51 @@ Ext.define('saas.view.document.kind.Kind', {
                 dataIndex: 'wh_description',
                 width: 200
             },{
-                text: '仓库状态',
+                text: '仓库状态',
                 dataIndex: 'wh_status',
-                width: 100
+                width: 0
+            },{
+                text: '仓库状态',
+                dataIndex: 'wh_statuscode',
+                width:90,
+                xtype: 'actioncolumn',
+                align : 'center',
+                items: [{
+                    icon:basePath + 'resource/images/16/lock_bg.png',
+                    tooltip: '锁定',
+                    iconCls:'',
+                    getClass: function(v, meta, rec) {
+                        if(rec.get('wh_statuscode')=='OPEN'){
+                            this.items[0].tooltip = '不启用';
+                            return 'x-grid-checkcolumn-checked';
+                        }else{
+                            this.items[0].tooltip = '启用';
+                            return 'x-grid-checkcolumn';
+                        }
+                    },
+                    handler: function(view, rowIndex, colIndex) {
+                        var rec = view.getStore().getAt(rowIndex);
+                        var type=rec.get('wh_statuscode')=='OPEN'?true:false;
+                        //  禁用/启用
+                        var form = this.ownerCt.ownerCt.ownerCt;
+                        var grid = this.ownerCt.ownerCt;
+                        form.BaseUtil.request({
+                            url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                            params: '',
+                            method: 'POST',
+                        })
+                        .then(function(localJson) {
+                            if(localJson.success){
+                                showToast('操作成功');
+                                grid.store.load();
+                            }
+                        })
+                        .catch(function(res) {
+                            console.error(res);
+                            showToast('操作失败: ' + res.message);
+                        });
+                    }
+                }]
             }],
             keyField:'id',
             reqUrl: basePath + 'document/warehouse/save',

+ 2 - 1
frontend/saas-web/app/view/document/kind/KindController.js

@@ -40,7 +40,8 @@ Ext.define('saas.view.document.kind.KindController', {
         me.createDialog(dataKind);
     },
     onRefresh:function(){
-
+        var me = this;
+        me.view.items.items[0].store.load();
     },
     insertActionColumn:function(columns){
         var me=this;

+ 2 - 1
frontend/saas-web/app/view/document/kind/KindModel.js

@@ -133,7 +133,8 @@ Ext.define('saas.view.document.kind.KindModel', {
                 {name: 'id', type: 'int'},
                 {name: 'wh_code',  type: 'string'},
                 {name: 'wh_description',  type: 'string'},
-                {name: 'wh_statuscode',  type: 'string'}
+                {name: 'wh_statuscode',  type: 'string'},
+                {name: 'wh_status',  type: 'string'}
             ],
             proxy: {
                 type: 'ajax',

+ 2 - 0
frontend/saas-web/app/view/document/other/StoreInformation.js

@@ -4,6 +4,8 @@ Ext.define('saas.view.document.other.StoreInformation', {
     autoScroll: true,
     layout:'fit',
     defaultType:'storeinformation',
+    _openUrl:basePath + 'document/warehouse/open',
+    _closeUrl:basePath + 'document/warehouse/close',
     tbar: ['->',{
         xtype:'button',
         text:'新增',

+ 4 - 4
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -44,14 +44,14 @@ Ext.define('saas.view.document.product.BasePanel', {
     _formXtype:'document-product-formpanel',
     _title:'物料资料',
     // _dataUrl:'http://192.168.253.31:9480/product/list',
-    _batchOpenUrl:'http://192.168.253.31:9480/product/batchOpen',
-    _batchCloseUrl:'http://192.168.253.31:9480/product/batchClose',
-    _batchDeleteUrl:'http://192.168.253.31:9480/product/batchDelete',
+    _batchOpenUrl:basePath + 'document/product/batchOpen',
+    _batchCloseUrl:basePath + 'document/product/batchClose',
+    _batchDeleteUrl:basePath + 'document/product/batchDelete',
 
     gridConfig: {
         idField: 'id',
         codeField: 'pr_code',
-        dataUrl: 'http://192.168.253.31:9480/product/list',
+        dataUrl: basePath + 'document/product/list',
         columns : [{
             text : "id", 
             width : 0, 

+ 3 - 3
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -212,9 +212,9 @@ Ext.define('saas.view.document.product.FormPanel', {
         statusCodeField = me._statusCodeField,
         viewModel = me.getViewModel();
         
-        viewModel.set('form.' + codeField, '--------------');
-        viewModel.set('form.createTime', new Date());
-        viewModel.set('form.updateTime', new Date());
+        viewModel.set(codeField, '');
+        viewModel.set('createTime', new Date());
+        viewModel.set('updateTime', new Date());
 
         if(statusCodeField) {
             var o = {};

+ 7 - 7
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -52,7 +52,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         columnWidth: 0.25
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/vendorkind/getCombo',
+        storeUrl:basePath + 'document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : "供应商类型", 
         allowBlank : true, 
@@ -64,8 +64,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             vendorkind:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/vendorkind/save',
-                delUrl:basePath+'ducument/vendorkind/delete'
+                reqUrl:basePath + 'document/vendorkind/save',
+                delUrl:basePath + 'document/vendorkind/delete'
             }
         },
         addHandler:function(b){
@@ -149,7 +149,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
-        _deleteDetailUrl:basePath+'ducument/vendor/deleteContact/',
+        deleteDetailUrl:basePath+'ducument/vendor/deleteContact/',
         columns : [
             {
                 text : "ID", 
@@ -245,9 +245,9 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         statusCodeField = me._statusCodeField,
         viewModel = me.getViewModel();
         
-        viewModel.set('form.' + codeField, '--------------');
-        viewModel.set('form.createTime', new Date());
-        viewModel.set('form.updateTime', new Date());
+        viewModel.set(codeField, '');
+        viewModel.set('createTime', new Date());
+        viewModel.set('updateTime', new Date());
 
         if(statusCodeField) {
             var o = {};

+ 21 - 0
frontend/saas-web/app/view/main/Main.scss

@@ -126,3 +126,24 @@ $treelist-nav-ui: (
 .x-formpanel-btn-blue .x-btn-inner-default-toolbar-small{
     color:#fff !important;
 }
+
+.x-grid-necessary .x-column-header-text:before{
+    content: '*';
+    font-size: 130%;
+    color: #ff0000;
+    width: 5px;
+    height: 5px;
+    margin-top: 4px;
+    margin-left: -10px;
+    position: absolute;
+}
+.x-grid-necessary{
+    text-align: center !important;
+    border-width: 1px;
+}
+.x-grid-necessary .x-column-header-text {
+    font: "microsoft yahei";
+    text-align: center;
+    font-size:14px;
+    font-weight: 500;
+}

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

@@ -104,6 +104,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 dataIndex : "pd_prodcode", 
                 xtype : "", 
                 items : null,
+                logic : 'necessaryField',
                 editor : {
                     displayField : "display", 
                     editable : true, 

+ 6 - 3
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -9,7 +9,11 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口
-                        dataUrl:basePath+'document/vendor/list',
+                        dataUrl: basePath + 'document/vendor/list',
+                        //新增地址
+                        addXtype:'document-vendor-formpanel',
+                        //新增标题
+                        addTitle:'供应商资料',
                         //赋值 
                         dbfinds:[{
                             from:'ve_code',to:'pu_vendcode'
@@ -23,12 +27,11 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             field:'ve_name',width:100
                         }],
                         //联想查询条件
-                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        dbtplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 
                             name : "ve_name", 
-                            conditionExpression:"ve_name like '{0}%'",//传入后台条件  替换占位符
                             fieldLabel : "供应商名称", 
                             columnWidth : 0.25
                         }],