123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /**
- * Created by zhouy on 2018/10/18.
- */
- Ext.define('trade.saas.view.document.warehouse.Window', {
- extend: 'saas.view.document.kind.ChildForm',
- xtype: 'document-warehouse-window',
- dataKind:'warehouse',//类型标识
- caller:'WareHouse',
- belong:{
- columns: [{
- text: '编号',
- dataIndex: 'wh_code',
- width: 150
- },{
- text: '仓库名称',
- dataIndex: 'wh_description',
- width: 200
- },{
- text: '类型',
- dataIndex: 'wh_type',
- width: 110
- },{
- 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')=='ENABLE'){
- 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')=='ENABLE'?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.showSuccessToast('操作成功');
- grid.store.load();
- }
- })
- .catch(function(e) {
- saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
- });
- }
- }]
- }],
- keyField:'id',
- reqUrl: '/api/document/warehouse/save',
- delUrl: '/api/document/warehouse/delete'
- },
- etc:{
- warehouse:{
- items:[{
- xtype:'hidden',
- name:'id'
- },{
- xtype:'textfield',
- fieldLabel: '仓库编号',
- name: 'wh_code',
- autoCode:true,
- allowBlank:false,
- maxLength: 20
- },{
- xtype:'textfield',
- fieldLabel: '仓库名称',
- name: 'wh_description',
- allowBlank:false,
- maxLength: 20
- },{
- xtype:'combo',
- fieldLabel: '仓库类型',
- name: 'wh_type',
- allowBlank:false,
- displayField : "display",
- editable:false,
- hideTrigger : false,
- maxLength : 100.0,
- minValue : null,
- positiveNum : false,
- queryMode : "local",
- valueField : "value",
- store:{
- fields: ['display', 'value'],
- data : [
- {"display":"良品仓", "value":'良品仓'},
- {"display":"不良品仓", "value":'不良品仓'}
- ]
- }
- },{
- readOnly:true,
- xtype:'textfield',
- fieldLabel: '仓库状态',
- name: 'wh_status',
- value:'已启用',
- maxLength: 20
- },{
- xtype:'hidden',
- fieldLabel: '仓库状态码',
- name: 'wh_statuscode',
- value:'ENABLE'
- }]
- }
- }
- });
|