info.js
2.72 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
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
'use strict';
var $ = require('jquery');
require('../util/jquery.gritter');
exports.cmd=function(jsonparam,callback){
//提交操作
function __ajax(options,callback){
$.ajax({
type: 'POST',
url: options.url,
dataType: 'json',
data:options.data||{},
success: function(res) {
res=res.data;
if (res.code === 200) {
$.gritter.add({
title: options.msg,
class_name: 'growl-success',
sticky: false,
time: '1000',
after_open: function() {
callback&&callback();
}
});
} else {
$.gritter.add({
title: '提交失败',
class_name: 'growl-danger',
sticky: false,
time: '1000'
});
}
}
});
}
//提交操作
$(document).on('click', '.btn-submit', function() {
var that = this;
jsonparam.status=300;
__ajax({
url:'/supplier/index/status',
data:jsonparam,
msg:'提交成功'
},function(){
callback&&callback();
});
});
//提交驳回
$(document).on('click', '.btn-return', function() {
var that = this;
jsonparam.status=400;
__ajax({
url:'/supplier/index/status',
data:jsonparam,
msg:'提交成功'
},function(){
callback&&callback();
});
});
//冻结操作
$(document).on('click', '.btn-freeze', function() {
var that = this;
jsonparam.isFreeze="Y";
__ajax({
url:'/supplier/index/status',
data:jsonparam,
msg:'提交成功'
},function(){
callback&&callback();
});
});
//解冻操作
$(document).on('click', '.btn-recovery', function() {
var that = this;
jsonparam.isFreeze="N";
__ajax({
url:'/supplier/index/status',
data:jsonparam,
msg:'提交成功'
},function(){
callback&&callback();
});
});
}
exports.init = function() {
if($("#status").val()==="200"){
$(".btn-return").add(".btn-submit").show();
}else{
$(".btn-return").add(".btn-submit").remove();
}
var Json={
id:$("#id").val(),
status:$("#status").val(),
operations:$("#operations").val()
}
exports.cmd(Json,function(){
history.go(-1);
});
}