| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- Ext.define('erp.view.pm.mes.Source',{
- extend: 'Ext.Viewport',
- layout: 'fit',
- hideBorders: true,
- initComponent : function(){
- var me = this;
- Ext.apply(me, {
- items: [{
- id:'SourceViewport',
- layout: 'anchor',
- items: [{
- xtype: 'erpFormPanel',
- anchor: '100% 30%',
- saveUrl: 'pm/mes/saveSource.action',
- deleteUrl: 'pm/mes/deleteSource.action',
- updateUrl: 'pm/mes/updateSource.action',
- getIdUrl: 'common/getId.action?seq=Source_SEQ',
- submitUrl: 'pm/mes/submitSource.action',
- auditUrl: 'pm/mes/auditSource.action',
- resAuditUrl: 'pm/mes/resAuditSource.action',
- resSubmitUrl: 'pm/mes/resSubmitSource.action',
- keyField: 'sc_id',
- codeField: 'sc_code',
- statusField: 'sc_status',
- statuscodeField: 'sc_statuscode'
- },{
- xtype: 'gridpanel',
- id: 'grid',
- anchor : '100% 70%',
- requires: ['erp.view.core.plugin.CopyPasteMenu'],
- columns: [{
- style :"text-align:center",
- text: '组别编号',
- width: 160,
- dataIndex: 'ur_groupcode',
- editor: {
- xtype: 'dbfindtrigger'
- },
- dbfind: 'CSUSERGROUP|UG_CODE',
- ignore: true,
- },{
- style :"text-align:center",
- text: 'ID',
- width: 0,
- hidden : true,
- dataIndex: 'ur_id',
- ignore: true,
- },{
- style :"text-align:center",
- text: '组别名称',
- width: 120,
- dataIndex: 'ug_name',
- ignore: true,
- logic:'ignore'
- },{
- text: '岗位资源编号',
- style :"text-align:center",
- width: 0,
- hidden : true,
- dataIndex: 'ur_resourcecode',
- ignore: true
- },{
- text: '维护人',
- style :"text-align:center",
- width: 100,
- hidden : false,
- readOnly: true,
- dataIndex: 'ug_inman',
- logic: 'ignore'
- },{
- text: '维护日期',
- style :"text-align:center",
- width: 120,
- hidden : false,
- readOnly: true,
- xtype: "datecolumn",
- dataIndex: 'ug_indate',
- logic: 'ignore'
- },{
- 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);
- view.ownerCt.deleteRecord(rec);
- }
- }]
- }],
- necessaryField: 'ur_groupcode',
- GridUtil: Ext.create('erp.util.GridUtil'),
- dbfinds: [{
- field: 'ur_groupcode',
- dbGridField: 'UG_CODE'
- },{
- field: 'ug_name',
- dbGridField: 'UG_NAME'
- },{
- field: 'ug_inman',
- dbGridField: 'UG_INMAN'
- },{
- field: 'ug_indate',
- dbGridField: 'UG_INDATE'
- }],
- columnLines: true,
- plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
- clicksToEdit: 1
- }),Ext.create('erp.view.core.plugin.CopyPasteMenu')],
- store: new Ext.data.Store({
- fields: ['ur_groupcode', 'ur_id', 'ug_name','ur_resourcecode'],
- data: [{},{},{},{}]
- }),
- deleteRecord: function(record) {
- if(record.get('ur_id') && record.get('ur_id') >= 0) {
- var grid = this, url = "pm/mes/deleteSourceDetail.action";
- var form = Ext.getCmp('form');
- grid.setLoading(true);
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- id: record.get('ur_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);
- }
- });
|