|
|
@@ -14,7 +14,8 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
requires: [
|
|
|
'Ext.Action',
|
|
|
'Ext.grid.plugin.CellEditing',
|
|
|
- 'Ext.selection.CellModel'
|
|
|
+ 'Ext.selection.CellModel',
|
|
|
+ 'Ext.grid.plugin.Exporter'
|
|
|
],
|
|
|
plugins: {
|
|
|
cellediting: {
|
|
|
@@ -24,7 +25,8 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
// context.column.fireEvent('edit', context.value);
|
|
|
// }
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ gridexporter: true
|
|
|
},
|
|
|
tbar: [{
|
|
|
xtype: 'hidden',
|
|
|
@@ -53,25 +55,9 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
storeUrl:'/api/document/producttype/getCombo',
|
|
|
name : "pr_kind",
|
|
|
bind:'{pr_kind}',
|
|
|
- emptyText : "类型",
|
|
|
- allowBlank : false,
|
|
|
- addHandler:function(b){
|
|
|
- var document = Ext.create('saas.view.document.kind.Kind',{});
|
|
|
- var form = this.ownerCmp.ownerCt;
|
|
|
- this.dialog = form.getController().getView().add({
|
|
|
- xtype: 'document-kind-childwin',
|
|
|
- bind: {
|
|
|
- title: '新增物料类型'
|
|
|
- },
|
|
|
- dataKind:'productkind',
|
|
|
- belong:document.etc['productkind'],
|
|
|
- _parent:form,
|
|
|
- _combo:this.ownerCmp,
|
|
|
- record:null,
|
|
|
- session: true
|
|
|
- });
|
|
|
- this.dialog.show();
|
|
|
- },
|
|
|
+ emptyText : "类型",
|
|
|
+ hiddenBtn:true,
|
|
|
+ allowBlank : false,
|
|
|
width:150
|
|
|
},{
|
|
|
xtype: 'hidden',
|
|
|
@@ -118,7 +104,8 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
text:'导出',
|
|
|
listeners: {
|
|
|
click:function(b){
|
|
|
-
|
|
|
+ var me = this.ownerCt.ownerCt;
|
|
|
+ me.onExport(me)
|
|
|
}
|
|
|
}
|
|
|
},{
|
|
|
@@ -281,9 +268,15 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
if (Ext.isEmpty(condition)) {
|
|
|
condition = "";
|
|
|
}
|
|
|
+ // Ext.apply(store.proxy.extraParams, {
|
|
|
+ // number: op._page,
|
|
|
+ // size: store.pageSize,
|
|
|
+ // condition: JSON.stringify(condition)
|
|
|
+ // });
|
|
|
Ext.apply(store.proxy.extraParams, {
|
|
|
- number: op._page,
|
|
|
- size: store.pageSize,
|
|
|
+ number: store.exportNumber?store.exportNumber:op._page,
|
|
|
+ size: store.exportPageSize?store.exportPageSize:store.pageSize,
|
|
|
+ mode:'MAIN',
|
|
|
condition: JSON.stringify(condition)
|
|
|
});
|
|
|
}
|
|
|
@@ -515,6 +508,41 @@ Ext.define('saas.view.stock.inventory.EditDataList', {
|
|
|
});
|
|
|
return dirtyData;
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
+ onImport:function(me){
|
|
|
+ console.log("导入");
|
|
|
+ },
|
|
|
+ onExport: function (me) {
|
|
|
+ // var grid = me.ownerCt.ownerCmp.ownerCt.ownerCt;
|
|
|
+ var grid = me;
|
|
|
+ //导出接口权限设置
|
|
|
+ var _url = grid.dataUrl.substring(0,grid.dataUrl.length-1);
|
|
|
+ var lastIndex = _url.lastIndexOf('/');
|
|
|
+ var caller = _url.substring(lastIndex);
|
|
|
+ var url = '/api/commons'+caller+'/export';
|
|
|
+ saas.util.BaseUtil.request({
|
|
|
+ url: url,
|
|
|
+ params: '',
|
|
|
+ method: 'GET',
|
|
|
+ })
|
|
|
+ .then(function(localJson) {
|
|
|
+ if(localJson.success){
|
|
|
+ grid.store.exportPageSize = 5000;
|
|
|
+ grid.store.exportNumber = 1;
|
|
|
+ grid.store.load(function(records, operation, success) {
|
|
|
+ grid.saveDocumentAs({
|
|
|
+ type: 'xlsx',
|
|
|
+ title: '盘点单列表',
|
|
|
+ fileName: '盘点单列表.xlsx'
|
|
|
+ });
|
|
|
+ grid.store.exportPageSize = null;
|
|
|
+ grid.store.exportNumber = null;
|
|
|
+ grid.store.load(function(records, operation, success) {
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function(res) {
|
|
|
+ saas.util.BaseUtil.showErrorToast('导出失败: ' + res.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|