|
|
@@ -49,6 +49,84 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
|
|
|
flex: 1,
|
|
|
dataIndex: "wh_type",
|
|
|
xtype: "",
|
|
|
- }]
|
|
|
+ }],
|
|
|
+
|
|
|
+ onAddClick: function() {
|
|
|
+ var me=this;
|
|
|
+ var tab = saas.util.BaseUtil.getCurrentTab();
|
|
|
+ // this.isEdit = !!record;
|
|
|
+ this.dialog = tab.add({
|
|
|
+ autoScroll:true,
|
|
|
+ xtype: 'document-kind-childwin',
|
|
|
+ bind: {
|
|
|
+ title: '新增仓库资料'
|
|
|
+ },
|
|
|
+ dataKind: 'warehouse',
|
|
|
+ belong: {
|
|
|
+ columns: [{
|
|
|
+ text: '编号',
|
|
|
+ dataIndex: 'wh_code',
|
|
|
+ width: 200
|
|
|
+ },{
|
|
|
+ text: '仓库名称',
|
|
|
+ dataIndex: 'wh_description',
|
|
|
+ width: 200
|
|
|
+ },{
|
|
|
+ text: '类型',
|
|
|
+ dataIndex: 'wh_type',
|
|
|
+ width: 200
|
|
|
+ },{
|
|
|
+ text: '仓库状态码',
|
|
|
+ dataIndex: 'wh_status',
|
|
|
+ hidden:true,
|
|
|
+ },{
|
|
|
+ text: '仓库状态',
|
|
|
+ dataIndex: 'wh_statuscode',
|
|
|
+ width:90,
|
|
|
+ xtype: 'actioncolumn',
|
|
|
+ align : 'center',
|
|
|
+ items: [{
|
|
|
+ iconCls:'',
|
|
|
+ getClass: function(v, meta, rec) {
|
|
|
+ if(rec.get('wh_statuscode')=='OPEN'){
|
|
|
+ return 'x-grid-checkcolumn-checked-btn';
|
|
|
+ }else{
|
|
|
+ return 'x-grid-checkcolumn-btn';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ saas.util.BaseUtil.request({
|
|
|
+ url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
|
|
|
+ params: '',
|
|
|
+ method: 'POST',
|
|
|
+ })
|
|
|
+ .then(function(localJson) {
|
|
|
+ if(localJson.success){
|
|
|
+ saas.util.BaseUtil.showToast('操作成功');
|
|
|
+ grid.store.load();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function(res) {
|
|
|
+ console.error(res);
|
|
|
+ saas.util.BaseUtil.showToast('操作失败: ' + res.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }],
|
|
|
+ keyField:'id',
|
|
|
+ reqUrl: '/api/document/warehouse/save',
|
|
|
+ delUrl: '/api/document/warehouse/delete'
|
|
|
+ },
|
|
|
+ // _parent:this.getView(),
|
|
|
+ // record:record,
|
|
|
+ session: true
|
|
|
+ });
|
|
|
+ this.dialog.show();
|
|
|
+ }
|
|
|
|
|
|
});
|