hy 7 лет назад
Родитель
Сommit
74ab4f91ce

+ 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 = {};

+ 14 - 3
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -110,18 +110,29 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         },
         storeinformation:{
             items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
                 xtype:'textfield',
                 fieldLabel: '仓库编号',
-                name: 'wh_code'
+                name: 'wh_code',
+                allowBlank:false
             },{
                 xtype:'textfield',
                 fieldLabel: '仓库名称',
-                name: 'wh_description'
+                name: 'wh_description',
+                allowBlank:false
             },{
                 readOnly:true,
                 xtype:'textfield',
                 fieldLabel: '仓库状态',
-                name: 'wh_status'
+                name: 'wh_status',
+                value:'已开启'
+            },{
+                xtype:'hidden',
+                fieldLabel: '仓库状态码',
+                name: 'wh_statuscode',
+                value:'OPEN'
             }]
         }
     },

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

@@ -154,9 +154,52 @@ 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) {
+                        debugger
+                        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',

+ 3 - 2
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',
@@ -143,7 +144,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 },
                 reader: {
                     type: 'json',
-                    rootProperty: 'data'
+                    rootProperty: 'data.list'
                 }
             },
             pageSize: null,

+ 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, 

+ 5 - 1
frontend/saas-web/app/view/document/product/FormController.js

@@ -16,6 +16,10 @@ Ext.define('saas.view.document.product.FormController', {
                         },{
                             from:'ve_name',to:'pr_vendname'
                         }],
+                        //新增地址
+                        addXtype:'document-vendor-formpanel',
+                        //新增标题
+                        addTitle:'供应商资料', 
                         //联想设置
                         dbtpls:[{
                             field:'ve_code',width:100
@@ -23,7 +27,7 @@ Ext.define('saas.view.document.product.FormController', {
                             field:'ve_name',width:100
                         }],
                         //联想查询条件
-                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        btplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 

+ 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 = {};

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

@@ -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 = {};