1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: huangtianyang
$Date: 2018/8/29 上午9:56
$Revision: 1.0
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
var header = $jq('meta[name=_csrf_header]').attr('content');
var token = $jq('meta[name=_csrf]').attr('content');
$jq(document).ajaxSend(function (e, xhr, options) {
xhr.setRequestHeader(header, token);
});
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'bf_pay_response');
$(ds_id).create({});
}
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'bf_pay_response');
var records = $(ds_id).getSelected();
if (records.length !== 1) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', '仅能选一条记录提交');
return;
}
if (!records[0].get('response_id')) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', '请先保存');
return;
}
$jq.ajax({
url: '${/request/@context_path}/baofoo/pay/req',
type: 'post',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({responseId: records[0].get('response_id')}),
success: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if (res.success) {
Leaf.SideBar.show({
msg: '保存成功',
duration: 2000
});
} else {
Leaf.showErrorMessage('提示', res.message);
}
$(ds_id).query();
},
failure: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', res.message);
},
error: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', res.message);
}
})
}
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'bf_pay_response');
var records = $(ds_id).getSelected();
if (records.length !== 1) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', '仅能选一条记录提交');
return;
}
if (!records[0].get('response_id')) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', '请先保存');
return;
}
$jq.ajax({
url: '${/request/@context_path}/baofoo/query/req',
type: 'post',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({responseId: records[0].get('response_id')}),
success: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if (res.success) {
Leaf.SideBar.show({
msg: '保存成功',
duration: 2000
});
} else {
Leaf.showErrorMessage('提示', res.message);
}
$(ds_id).query();
},
failure: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', res.message);
},
error: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showErrorMessage('提示', res.message);
}
})
}
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>