|
@@ -305,8 +305,7 @@ var _default = {
|
|
|
},
|
|
},
|
|
|
// 考勤组选择框取消回调事件
|
|
// 考勤组选择框取消回调事件
|
|
|
treeCancel: function treeCancel(e) {
|
|
treeCancel: function treeCancel(e) {
|
|
|
- console.log(e);
|
|
|
|
|
- console.log("取消");
|
|
|
|
|
|
|
+ // this.$refs.tkitree._hide()
|
|
|
},
|
|
},
|
|
|
// 点击选择考勤组选择框回调
|
|
// 点击选择考勤组选择框回调
|
|
|
handleChoose: function handleChoose() {
|
|
handleChoose: function handleChoose() {
|
|
@@ -317,7 +316,7 @@ var _default = {
|
|
|
while (1) {
|
|
while (1) {
|
|
|
switch (_context2.prev = _context2.next) {
|
|
switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
case 0:
|
|
|
- _this2.$refs.tkitree._show();
|
|
|
|
|
|
|
+ _this2.range = [];
|
|
|
_context2.next = 3;
|
|
_context2.next = 3;
|
|
|
return _this2.$myRequest({
|
|
return _this2.$myRequest({
|
|
|
url: "/attendance/api/settings/org/tree"
|
|
url: "/attendance/api/settings/org/tree"
|
|
@@ -327,6 +326,7 @@ var _default = {
|
|
|
// console.log(res);
|
|
// console.log(res);
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
_this2.range = res.data;
|
|
_this2.range = res.data;
|
|
|
|
|
+ _this2.$refs.tkitree._show();
|
|
|
}
|
|
}
|
|
|
case 5:
|
|
case 5:
|
|
|
case "end":
|
|
case "end":
|
|
@@ -337,7 +337,7 @@ var _default = {
|
|
|
}))();
|
|
}))();
|
|
|
},
|
|
},
|
|
|
handleChange: function handleChange(item) {
|
|
handleChange: function handleChange(item) {
|
|
|
- console.log(item);
|
|
|
|
|
|
|
+ // console.log(item);
|
|
|
item.checked = !item.checked;
|
|
item.checked = !item.checked;
|
|
|
},
|
|
},
|
|
|
// 点击弹窗保存按钮回调
|
|
// 点击弹窗保存按钮回调
|
|
@@ -369,17 +369,37 @@ var _default = {
|
|
|
});
|
|
});
|
|
|
return _context3.abrupt("return");
|
|
return _context3.abrupt("return");
|
|
|
case 6:
|
|
case 6:
|
|
|
- if (_this3.group_num) {
|
|
|
|
|
|
|
+ if (!(_this3.group_total == 0)) {
|
|
|
_context3.next = 9;
|
|
_context3.next = 9;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: "请输入打卡人数",
|
|
|
|
|
|
|
+ title: "该考勤组范围中人数为0,请重新选择",
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
});
|
|
});
|
|
|
return _context3.abrupt("return");
|
|
return _context3.abrupt("return");
|
|
|
case 9:
|
|
case 9:
|
|
|
- _context3.next = 11;
|
|
|
|
|
|
|
+ if (_this3.group_num) {
|
|
|
|
|
+ _context3.next = 12;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "请输入打卡人数",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ return _context3.abrupt("return");
|
|
|
|
|
+ case 12:
|
|
|
|
|
+ if (!(_this3.group_num - 0 > _this3.group_total - 0)) {
|
|
|
|
|
+ _context3.next = 15;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "打卡人数不能超过总人数",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ return _context3.abrupt("return");
|
|
|
|
|
+ case 15:
|
|
|
|
|
+ _context3.next = 17;
|
|
|
return _this3.$myRequest({
|
|
return _this3.$myRequest({
|
|
|
url: "/attendance/api/settings/group/add",
|
|
url: "/attendance/api/settings/group/add",
|
|
|
method: "post",
|
|
method: "post",
|
|
@@ -394,11 +414,25 @@ var _default = {
|
|
|
userOrgList: _this3.userOrgList
|
|
userOrgList: _this3.userOrgList
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- case 11:
|
|
|
|
|
|
|
+ case 17:
|
|
|
res = _context3.sent;
|
|
res = _context3.sent;
|
|
|
- console.log(res);
|
|
|
|
|
- _this3.$refs.popup.close();
|
|
|
|
|
- case 14:
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ _this3.$refs.popup.close();
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "添加成功",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ _this3.getGroupData();
|
|
|
|
|
+ }, 1500);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.message,
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ case 19:
|
|
|
case "end":
|
|
case "end":
|
|
|
return _context3.stop();
|
|
return _context3.stop();
|
|
|
}
|
|
}
|
|
@@ -412,42 +446,104 @@ var _default = {
|
|
|
},
|
|
},
|
|
|
// 点击新增考勤组按钮回调
|
|
// 点击新增考勤组按钮回调
|
|
|
handleAdd: function handleAdd() {
|
|
handleAdd: function handleAdd() {
|
|
|
|
|
+ var _this4 = this;
|
|
|
this.group_name = "";
|
|
this.group_name = "";
|
|
|
this.group_num = null;
|
|
this.group_num = null;
|
|
|
this.group_total = 0;
|
|
this.group_total = 0;
|
|
|
|
|
+ this.group_scope = "";
|
|
|
this.userOrgList = [];
|
|
this.userOrgList = [];
|
|
|
- this.$refs.popup.open();
|
|
|
|
|
|
|
+ this.$nextTick(function () {
|
|
|
|
|
+ _this4.$refs.popup.open();
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
// 点击关联考勤组按钮回调
|
|
// 点击关联考勤组按钮回调
|
|
|
handleRelevancy: function handleRelevancy() {
|
|
handleRelevancy: function handleRelevancy() {
|
|
|
- console.log(456);
|
|
|
|
|
|
|
+ var temList = [];
|
|
|
|
|
+ this.list.forEach(function (ele) {
|
|
|
|
|
+ if (ele.checked == true) {
|
|
|
|
|
+ temList.push(ele.name);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (temList.length == 0) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "请先勾选考勤组",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.setStorageSync("ruleGroup", temList);
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta: 1
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 点击树状节点回调
|
|
// 点击树状节点回调
|
|
|
nodechange: function nodechange(ref) {
|
|
nodechange: function nodechange(ref) {
|
|
|
- var _this4 = this;
|
|
|
|
|
|
|
+ var _this5 = this;
|
|
|
this.$nextTick(function () {
|
|
this.$nextTick(function () {
|
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
|
- _this4.$refs[ref][0].resize();
|
|
|
|
|
|
|
+ _this5.$refs[ref][0].resize();
|
|
|
}, 200);
|
|
}, 200);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 点击右侧删除按钮回调
|
|
// 点击右侧删除按钮回调
|
|
|
onClick: function onClick(id) {
|
|
onClick: function onClick(id) {
|
|
|
- console.log(id);
|
|
|
|
|
|
|
+ var _this6 = this;
|
|
|
|
|
+ // console.log(id);
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
content: '确定删除该考勤组吗?',
|
|
content: '确定删除该考勤组吗?',
|
|
|
- success: function success(res) {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- console.log('用户点击确定');
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "删除成功",
|
|
|
|
|
- icon: 'success'
|
|
|
|
|
- });
|
|
|
|
|
- } else if (res.cancel) {
|
|
|
|
|
- console.log('用户点击取消');
|
|
|
|
|
|
|
+ success: function () {
|
|
|
|
|
+ var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(res) {
|
|
|
|
|
+ var _res;
|
|
|
|
|
+ return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
|
|
|
+ while (1) {
|
|
|
|
|
+ switch (_context4.prev = _context4.next) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ if (!res.confirm) {
|
|
|
|
|
+ _context4.next = 7;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ _context4.next = 3;
|
|
|
|
|
+ return _this6.$myRequest({
|
|
|
|
|
+ url: "/attendance/api/settings/group/delete",
|
|
|
|
|
+ method: "delete",
|
|
|
|
|
+ data: {
|
|
|
|
|
+ ids: [id]
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ _res = _context4.sent;
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ if (_res.code == 200) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "删除成功",
|
|
|
|
|
+ icon: 'success'
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ _this6.getGroupData();
|
|
|
|
|
+ }, 1500);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: _res.message,
|
|
|
|
|
+ icon: 'success'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ _context4.next = 8;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 7:
|
|
|
|
|
+ if (res.cancel) {}
|
|
|
|
|
+ case 8:
|
|
|
|
|
+ case "end":
|
|
|
|
|
+ return _context4.stop();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, _callee4);
|
|
|
|
|
+ }));
|
|
|
|
|
+ function success(_x) {
|
|
|
|
|
+ return _success.apply(this, arguments);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ return success;
|
|
|
|
|
+ }()
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 清除搜索框内容时的回调
|
|
// 清除搜索框内容时的回调
|