changeLastPrice.js
1.27 KB
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
/**
* 修改开盘价
*/
var ChangeLastPrice = function() {
return {
search : function() {
$("#data-grid").datagrid({
url : "/price/search",
queryParams : App.dataGridQueryParams('search-form')
});
},
lastPrice : function(){
var row = $("#data-grid").datagrid("getSelected");
if(row){
$("#mchCode").numberbox('setValue', row.MCH_CODE);
$("#mchCode").numberbox('setText', row.MCH_CODE);
$("#mchName").textbox('setText', row.MCH_NAME);
$("#mchName").textbox('setValue', row.MCH_NAME);
$("#lastPrice").numberbox('setText', "");
$("#lastPrice").numberbox('setValue', "");
$("#price-dialog").dialog('open');
}else{
$.messager.alert('Warning', '请选择要修改开盘价的数据');
}
},
lastPriceChange : function(){
$("#price-form").form('submit', {
url : '/price/change',
onSubmit : function(param) {
return $(this).form('validate');
},
success : function(data){
var result = $.parseJSON(data);
if(result.resultCode == "1"){
$.messager.alert("提示", "开盘价修改完毕");
$("#price-dialog").dialog('close');
$("#data-grid").datagrid('reload');
}else{
$.messager.alert("错误", result.resultMsg);
}
}
});
},
}
}();