12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- Ext.define('erp.view.core.button.GetMakePrepareBarcode',{
- extend: 'Ext.Button',
- alias: 'widget.erpGetMPBarcodeButton',
- id: 'erpGetMPBarcodeButton',
- iconCls : 'x-button-icon-submit',
- cls : 'x-btn-gray',
- text : $I18N.common.button.erpGetMPBarcodeButton,
- style : {
- marginLeft : '10px'
- },
- width:120,
- initComponent : function(){
- this.callParent(arguments);
- },
- handler: function(btn){
- this.getMPBarcodeButton(btn);
- },
- getMPBarcodeButton:function(btn){
- var form = Ext.getCmp('form'),
- keyvalue = Ext.getCmp(form.keyField).value;
- warnMsg('是否确认获取料卷号?', function(btn){
- if(btn == 'yes'){
- form.BaseUtil.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + "pm/mes/getMakePrepareBarcode.action",
- params: {
- id: keyvalue
- },
- method : 'post',
- callback : function(options,success,response){
- form.BaseUtil.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- var str = localJson.exceptionInfo;
- if(str.trim().substr(0, 12) == 'AFTERSUCCESS'){//特殊情况:操作成功,但是出现警告,允许刷新页面
- str = str.replace('AFTERSUCCESS<br>', '');
- showMessage('提示', str);
- return;
- }else{
- showError(str);return;
- }
- }
- if(localJson.success){
- showMessage('提示', '获取成功!', 1000);
- window.location.reload();
- } else {
- showError('获取失败!');
- return;
- }
- }
- });
- }
- });
- }
- });
|