123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- Ext.define('erp.view.pm.make.MakeSNRule',{
- extend: 'Ext.Viewport',
- layout: 'fit',
- hideBorders: true,
- initComponent : function(){
- var me = this;
- Ext.apply(me, {
- items: [{
- layout: 'anchor',
- items: [{
- xtype: 'erpFormPanel',
- anchor: '100% 30%',
- updateUrl: 'pm/make/updateMakeSNRule.action',
- getIdUrl: 'common/getId.action?seq=MakeStepChange_SEQ',
- keyField: 'ma_id'
- },{
- xtype: 'gridpanel',
- id: 'grid',
- mainField: 'msr_maid',
- anchor : '100% 70%',
- columns: [{
- style :"text-align:center",
- text: '<font color="red">类型</font>',
- width: 100,
- dataIndex: 'msr_type',
- editor:{
- xtype:"combo",
- format:"",
- hideTrigger:false,
- store:{
- fields:[
- 'display',
- 'value'
- ],
- data:[
- {
- display:"转换前",
- value:"before"
- },
- {
- display:"转换后",
- value:"after"
- }
- ]
- },
- queryMode:"local",
- displayField:"display",
- valueField:"value",
- editable:false,
- cls:null,
- minValue:null,
- maxLength:4000,
- positiveNum:false
- },
- xtype: "combocolumn"
- },{
- style :"text-align:center",
- text: 'ID',
- width: 0,
- hidden : true,
- dataIndex: 'msr_id',
- ignore: true,
- },{
- style :"text-align:center",
- text: '<font color="red">序列号前缀</font>',
- width: 120,
- dataIndex: 'msr_prefix',
- logic:"necessaryField",
- editor: {
- xtype: "textfield",
- hideTrigger: true,
- store: null,
- queryMode: "local",
- editable: true,
- cls: null,
- minValue: "0",
- maxLength: 4000,
- positiveNum: false
- }
- },{
- style :"text-align:center",
- text: '<font color="red">数量</font>',
- width: 80,
- dataIndex: 'msr_qty',
- logic:"necessaryField",
- editor: {
- xtype: "numberfield",
- hideTrigger: true,
- store: null,
- queryMode: "local",
- editable: true,
- cls: null,
- minValue: "0",
- maxLength: 4000,
- positiveNum: false
- },
- xtype: 'numbercolumn',
- align: "right",
- format: ""
- },{
- style :"text-align:center",
- text: '<font color="red">长度</font>',
- logic:"necessaryField",
- width: 80,
- dataIndex: 'msr_length',
- editor: {
- xtype: "numberfield",
- hideTrigger: true,
- store: null,
- queryMode: "local",
- editable: true,
- cls: null,
- minValue: "0",
- maxLength: 4000,
- positiveNum: false
- },
- xtype: 'numbercolumn',
- align: "right",
- format: ""
- },{
- style :"text-align:center",
- text: '<font color="red">进制</font>',
- logic:"necessaryField",
- width: 100,
- dataIndex: 'msr_system',
- editor:{
- xtype:"combo",
- format:"",
- hideTrigger:false,
- store:{
- fields:[
- 'display',
- 'value'
- ],
- data:[
- {
- display:"十进制",
- value:"decimal"
- },
- {
- display:"十六进制",
- value:"hexadecimal"
- },
- {
- display:"三十二进制",
- value:"32hexadecimal"
- },
- {
- display:"三十六进制",
- value:"36hexadecimal"
- }
- ]
- },
- queryMode:"local",
- displayField:"display",
- valueField:"value",
- editable:false,
- cls:null,
- minValue:null,
- maxLength:4000,
- positiveNum:false
- },
- xtype: "combocolumn"
- },{
- style :"text-align:center",
- text: '<font color="red">起始序列号</font>',
- logic:"necessaryField",
- width: 120,
- dataIndex: 'msr_startno',
- editor: {
- xtype: "textfield",
- hideTrigger: true,
- store: null,
- queryMode: "local",
- editable: true,
- cls: null,
- minValue: "0",
- maxLength: 4000,
- positiveNum: false
- }
- },{
- style :"text-align:center",
- text: '结束序列号',
- width: 120,
- dataIndex: 'msr_endno'
- },{
- style :"text-align:center",
- text: '更新人',
- width: 100,
- dataIndex: 'msr_updateman'
- },{
- style :"text-align:center",
- text: '更新日期',
- width: 150,
- dataIndex: 'msr_updatedate',
- readOnly: true,
- align:"left",
- format:"Y-m-d H:i:s",
- xtype:"datecolumn"
- },{
- style :"text-align:center",
- xtype: 'actioncolumn',
- header: '操作',
- width: 100,
- align: 'center',
- items: [{
- icon: basePath + 'resource/images/16/delete.png',
- tooltip: '删除',
- handler: function(view, rowIndex, colIndex) {
- var rec = view.getStore().getAt(rowIndex);
- warnMsg('确定删除?', function(btn){
- if(btn == 'yes'){
- view.ownerCt.deleteRecord(rec);
- } else if(btn == 'no'){
- return;
- }
- })
- }
- }]
- }],
- GridUtil: Ext.create('erp.util.GridUtil'),
- dbfinds: [],
- columnLines: true,
- plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
- clicksToEdit: 1
- }),Ext.create('erp.view.core.plugin.CopyPasteMenu')],
- store: new Ext.data.Store({
- fields: ['msr_id', 'msr_type', 'msr_prefix','msr_qty', 'msr_length', 'msr_system','msr_startno', 'msr_endno', 'msr_updateman','msr_updatedate'],
- data: [{},{}]
- }),
- necessaryFields:['msr_prefix','msr_qty', 'msr_length', 'msr_system','msr_startno'],
- deleteRecord: function(record) {
- if(record.get('msr_id') && record.get('msr_id') >= 0) {
- var grid = this, url = "pm/make/deleteMakeSNRuleDetail.action";
- var form = Ext.getCmp('form');
- grid.setLoading(true);
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- id: record.get('msr_id'),
- key: Ext.getCmp(form.keyField).value
- },
- method : 'post',
- callback : function(opt, success, response){
- grid.setLoading(false);
- success && grid.store.remove(record);
- }
- });
- } else {
- this.store.remove(record);
- }
- }
- }]
- }]
- });
- me.callParent(arguments);
- }
- });
|