selectStaff.js
3.07 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
(function (vc) {
var default_row = 50;
vc.extends({
data: {
selectStaffInfo: {
flowId: '',
flowName: '',
describle: '',
companys: [],
departments: [],
staffs: [],
curCompanyId: '',
curDepartmentId: '',
curStaffId: '',
curStaffName: '',
staff: {}
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('selectStaff', 'openStaff', function (_staff) {
//查询公司信息
$('#selectStaffModel').modal('show');
$that.selectStaffInfo.staff = _staff;
$that.staff = _staff;
vc.emit('orgTreeShow', 'refreshTree', {})
});
vc.on('selectStaff', 'switchOrg', function (_param) {
$that.loadStaff(_param);
})
},
methods: {
_changeStaff: function (item) {
console.log(item);
$that.staff.staffId = item.userId;
$that.staff.staffName = item.userName;
$that.staff.staffTel = item.tel;
$('#selectStaffModel').modal('hide');
if ($that.staff.hasOwnProperty('call')) {
$that.staff.call($that.staff);
}
},
loadStaff: function (_org) {
let param = {
params: {
page: 1,
rows: default_row,
row: default_row,
orgId: _org.orgId
}
};
//发送get请求
vc.http.apiGet('/query.staff.infos',
param,
function (json) {
var _staffInfo = JSON.parse(json);
$that.selectStaffInfo.staffs = _staffInfo.staffs;
if (_staffInfo.staffs.length < 1) {
return;
}
$that.selectStaffInfo.curStaffId = _staffInfo.staffs[0].orgId
},
function () {
console.log('请求失败处理');
}
);
},
_firstUser: function () {
$that.staff.staffId = '${startUserId}';
$that.staff.staffName = '提交者';
$('#selectStaffModel').modal('hide');
if ($that.staff.hasOwnProperty('call')) {
$that.staff.call($that.staff);
}
},
_customUser: function () {
$that.staff.staffId = '${nextUserId}';
$that.staff.staffName = '动态指定';
$('#selectStaffModel').modal('hide');
if ($that.staff.hasOwnProperty('call')) {
$that.staff.call($that.staff);
}
}
}
});
})(window.vc);