<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: zhangxing5129 $Date: 2014-7-30 下午01:54:14 $Revision: 1.0 $Purpose: 商机创建 --> <a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:view> <a:link id="get_special_fields_link_id" model="cont.CON500.con_contract_get_special_fields" modelaction="update"/> <script type="text/javascript"><![CDATA[ //保存前调用,生成商机编号 window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); var check_flag = false; if (record.get('chance_number')) { return true; } Leaf.request({ url: $('get_special_fields_link_id').getUrl(), para: { document_category: record.get('document_category'), document_type: record.get('document_type'), function_code: '${/parameter/@function_code}', function_usage: '${/parameter/@function_usage}' }, success: function(res) { var document_number = res.result.document_number; record.set('chance_number', document_number); record.set('company_id', '${/session/@company_id}'); check_flag = true; }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, failure: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, sync: true, scope: this }); return check_flag; }; ]]></script> </a:view> </a:screen>