|
@@ -1330,7 +1330,8 @@ $(document).ready(function() {
|
|
|
}
|
|
|
self.syncFiling(self.curFiling, selectFilingId);
|
|
|
toastr.success('同步成功');
|
|
|
- $('[name=cbft]').removeAttr('checked');
|
|
|
+ self.permissionTree.nodes.forEach(x => { x.check = false; });
|
|
|
+ SpreadJsObj.reloadColData(self.sheet, 1);
|
|
|
$('#filing-select-all')[0].checked = false;
|
|
|
});
|
|
|
$('#batch-del-filing').click(() => {
|
|
@@ -1344,6 +1345,27 @@ $(document).ready(function() {
|
|
|
self.delFiling(self.curFiling, userId);
|
|
|
self.loadCurFiling();
|
|
|
});
|
|
|
+ $('#batch-add-filing').click(() => {
|
|
|
+ const selectFilingId = [];
|
|
|
+ self.permissionTree.nodes.forEach(x => { if (x.check && (!x.children || x.children.length === 0)) selectFilingId.push(x.filing_type); });
|
|
|
+ if (selectFilingId.length === 0) {
|
|
|
+ toastr.warning('请先选择文档类别');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const selectUser = $('[name=ftu-check]:checked');
|
|
|
+ if (selectUser.length === 0) {
|
|
|
+ toastr.warning('请先选择用户');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const userId = [];
|
|
|
+ selectUser.each((i, x) => { userId.push(x.getAttribute('uid')); });
|
|
|
+ self.batchAddFiling(selectFilingId, userId);
|
|
|
+ self.loadCurFiling();
|
|
|
+ toastr.success('批量添加成功');
|
|
|
+ self.permissionTree.nodes.forEach(x => { x.check = false; });
|
|
|
+ SpreadJsObj.reloadColData(self.sheet, 1);
|
|
|
+ $('#filing-select-all')[0].checked = false;
|
|
|
+ });
|
|
|
$('body').on('click', '[name=del-filing]', function() {
|
|
|
const id = this.getAttribute('uid');
|
|
|
self.delFiling(self.curFiling, id);
|
|
@@ -1467,6 +1489,15 @@ $(document).ready(function() {
|
|
|
if (pu.filing_type.indexOf(filingId) >= 0) pu.filing_type.splice(pu.filing_type.indexOf(filingId), 1);
|
|
|
}
|
|
|
}
|
|
|
+ batchAddFiling(filingIds, userId) {
|
|
|
+ for (const pu of this.permissionUser) {
|
|
|
+ if (userId.indexOf(pu.id) < 0) continue;
|
|
|
+
|
|
|
+ filingIds.forEach(fid => {
|
|
|
+ if (pu.filing_type.indexOf(fid) < 0) pu.filing_type.push(fid);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
savePermission() {
|
|
|
const self = this;
|
|
|
const data = this.permissionUser.map(x => {
|