| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /**
- * 修改供应商UU按钮
- */
- Ext.define('erp.view.core.button.VendorUU', {
- extend : 'Ext.Button',
- alias : 'widget.erpVendorUUButton',
- iconCls : 'x-btn-uu-medium',
- cls : 'x-btn-gray',
- text : $I18N.common.button.erpVendorUUButton,
- style : {
- marginLeft : '10px'
- },
- width : 120,
- initComponent : function() {
- this.callParent(arguments);
- },
- listeners: {
- afterrender: function(btn) {
- var status = Ext.getCmp('ve_auditstatuscode');
- if(status && status.value == 'ENTERING'){
- btn.hide();
- }
- }
- },
- handler: function() {
- var me = this, win = Ext.getCmp('vendoruu-win');
- if(!win) {
- var f = Ext.getCmp('ve_uu'),
- val = f ? f.value : '';
- win = Ext.create('Ext.Window', {
- id: 'vendoruu-win',
- title: '设置供应商 ' + Ext.getCmp('ve_code').value + ' 的UU号',
- height: 200,
- width: 400,
- items: [{
- margin: '30 0 0 0',
- xtype: 'textfield',
- fieldLabel: '供应商UU号',
- value: val
- }],
- closeAction: 'hide',
- buttonAlign: 'center',
- layout: {
- type: 'vbox',
- align: 'center'
- },
- buttons: [{
- text: $I18N.common.button.erpConfirmButton,
- cls: 'x-btn-blue',
- handler: function(btn) {
- var tx = btn.ownerCt.ownerCt.down('textfield');
- if(tx.isDirty() && !Ext.isEmpty(tx.value)) {
- me.updateVendorUU(Ext.getCmp('ve_id').value, tx.value);
- }
- }
- }, {
- text: $I18N.common.button.erpCloseButton,
- cls: 'x-btn-blue',
- handler: function(btn) {
- btn.ownerCt.ownerCt.hide();
- }
- }]
- });
- }
- win.show();
- },
- updateVendorUU: function(id, val) {
- Ext.Ajax.request({
- url: basePath + 'scm/vendor/updateUU.action',
- params: {
- id: id,
- uu: val
- },
- callback: function(opt, s, r) {
- var rs = Ext.decode(r.responseText);
- if(rs.exceptionInfo) {
- showError(rs.exceptionInfo);
- } else {
- alert('设置成功!');
- window.location.reload();
- }
- }
- });
- }
- });
|