|
@@ -3509,7 +3509,7 @@ $(document).ready(() => {
|
|
|
}, 100);
|
|
|
});
|
|
|
})('a[name=showLevel]', billsSheet);
|
|
|
-
|
|
|
+if (openRevise) {
|
|
|
const dataChecker = DataChecker({
|
|
|
checkUrl: window.location.pathname + '/check',
|
|
|
completeData: function (data) {
|
|
@@ -3545,7 +3545,7 @@ $(document).ready(() => {
|
|
|
let compilationList = [];
|
|
|
$('#get-dsk-btn').click(function () {
|
|
|
// 判断是否已绑定dsk用户
|
|
|
- postData('/profile/dsk/api', { type: 'hadbind' }, function (result) {
|
|
|
+ postData('/profile/dsk/api', {type: 'hadbind'}, function (result) {
|
|
|
if (result === 1) {
|
|
|
$('#error-dsk .modal-body').find('h5').eq(0).show();
|
|
|
$('#error-dsk .modal-body').find('h5').eq(1).hide();
|
|
@@ -3557,7 +3557,11 @@ $(document).ready(() => {
|
|
|
$('#error-dsk').modal('show');
|
|
|
$('#error-dsk .modal-footer').find('a').eq(0).text('绑定账号');
|
|
|
} else {
|
|
|
- postData('/profile/dsk/api', { type: 'compilation', getProject: 1, compilationId: getLocalCache(dskCompilation) }, function (result) {
|
|
|
+ postData('/profile/dsk/api', {
|
|
|
+ type: 'compilation',
|
|
|
+ getProject: 1,
|
|
|
+ compilationId: getLocalCache(dskCompilation)
|
|
|
+ }, function (result) {
|
|
|
let html = '';
|
|
|
for (const data of result.compilation) {
|
|
|
html += `<option value="${data.ID}" ${result.select_compilation === data.ID ? 'selected' : ''}>${data.name}</option>`;
|
|
@@ -3574,7 +3578,7 @@ $(document).ready(() => {
|
|
|
})
|
|
|
});
|
|
|
$('#get-dsk-bills-btn').click(function () {
|
|
|
- const projectInfo = _.find(dskProjects, { pid: dskAccountData.select_project ? dskAccountData.select_project : null });
|
|
|
+ const projectInfo = _.find(dskProjects, {pid: dskAccountData.select_project ? dskAccountData.select_project : null});
|
|
|
changeDskProjectTree(projectInfo, dskAccountData.select_tree ? dskAccountData.select_tree : null);
|
|
|
});
|
|
|
|
|
@@ -3598,6 +3602,7 @@ $(document).ready(() => {
|
|
|
grArray: dskProjects ? dskProjects : [],
|
|
|
orgSelect: null,
|
|
|
};
|
|
|
+
|
|
|
function makeDskProjectSjsHtml(datas) {
|
|
|
if (!dp) {
|
|
|
initDskProjectTree();
|
|
@@ -3612,13 +3617,19 @@ $(document).ready(() => {
|
|
|
$('#show-project-0').hide();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const dskProjectSpreadObj = {
|
|
|
_addTender: function (tender) {
|
|
|
const gr = gsObj.grArray.find(function (x) {
|
|
|
return x.pid === tender.pid;
|
|
|
});
|
|
|
const c_id = getLocalCache(dskCompilation);
|
|
|
- const t = {pid: tender.pid, name: tender.name, compilationId: c_id, compilationName: _.find(compilationList, { ID: c_id }).name };
|
|
|
+ const t = {
|
|
|
+ pid: tender.pid,
|
|
|
+ name: tender.name,
|
|
|
+ compilationId: c_id,
|
|
|
+ compilationName: _.find(compilationList, {ID: c_id}).name
|
|
|
+ };
|
|
|
if (!gr) gsObj.grArray.push(t);
|
|
|
return t;
|
|
|
},
|
|
@@ -3634,7 +3645,7 @@ $(document).ready(() => {
|
|
|
refreshSourceTree: function () {
|
|
|
const c_id = getLocalCache(dskCompilation);
|
|
|
if (c_id) {
|
|
|
- postData('/profile/dsk/api', { type: 'project', compilationId: c_id }, function (result) {
|
|
|
+ postData('/profile/dsk/api', {type: 'project', compilationId: c_id}, function (result) {
|
|
|
makeDskProjectSjsHtml(result);
|
|
|
});
|
|
|
}
|
|
@@ -3651,7 +3662,7 @@ $(document).ready(() => {
|
|
|
const posterity = gsObj.tenderSourceTree.getPosterity(node);
|
|
|
for (const p of posterity) {
|
|
|
p.selected = node.selected;
|
|
|
- if ((!p.children || p.children.length === 0) && p.type === 2){
|
|
|
+ if ((!p.children || p.children.length === 0) && p.type === 2) {
|
|
|
if (p.selected) {
|
|
|
dskProjectSpreadObj._addTender(p);
|
|
|
} else {
|
|
@@ -3695,8 +3706,25 @@ $(document).ready(() => {
|
|
|
gsObj.gsSheet = gsSpread.getActiveSheet();
|
|
|
const gsSpreadSetting = {
|
|
|
cols: [
|
|
|
- {title: '选择', field: 'selected', hAlign: 1, width: 40, formatter: '@', cellType: 'checkbox', readOnly: true,},
|
|
|
- {title: '名称', field: 'name', hAlign: 0, width: 400, formatter: '@', readOnly: true, folderCell: true, cellType: 'tree'},
|
|
|
+ {
|
|
|
+ title: '选择',
|
|
|
+ field: 'selected',
|
|
|
+ hAlign: 1,
|
|
|
+ width: 40,
|
|
|
+ formatter: '@',
|
|
|
+ cellType: 'checkbox',
|
|
|
+ readOnly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '名称',
|
|
|
+ field: 'name',
|
|
|
+ hAlign: 0,
|
|
|
+ width: 400,
|
|
|
+ formatter: '@',
|
|
|
+ readOnly: true,
|
|
|
+ folderCell: true,
|
|
|
+ cellType: 'tree'
|
|
|
+ },
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -3714,8 +3742,28 @@ $(document).ready(() => {
|
|
|
gsObj.grSheet = grSpread.getActiveSheet();
|
|
|
const grSpreadSetting = {
|
|
|
cols: [
|
|
|
- {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 250, formatter: '@', readOnly: true, cellType: 'ellipsisAutoTip', scrollHeightClass: '.modal-height-500'},
|
|
|
- {title: '所属编办', colSpan: '1', rowSpan: '1', field: 'compilationName', hAlign: 0, width: 150, formatter: '@', readOnly: true},
|
|
|
+ {
|
|
|
+ title: '名称',
|
|
|
+ colSpan: '1',
|
|
|
+ rowSpan: '1',
|
|
|
+ field: 'name',
|
|
|
+ hAlign: 0,
|
|
|
+ width: 250,
|
|
|
+ formatter: '@',
|
|
|
+ readOnly: true,
|
|
|
+ cellType: 'ellipsisAutoTip',
|
|
|
+ scrollHeightClass: '.modal-height-500'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所属编办',
|
|
|
+ colSpan: '1',
|
|
|
+ rowSpan: '1',
|
|
|
+ field: 'compilationName',
|
|
|
+ hAlign: 0,
|
|
|
+ width: 150,
|
|
|
+ formatter: '@',
|
|
|
+ readOnly: true
|
|
|
+ },
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -3773,8 +3821,8 @@ $(document).ready(() => {
|
|
|
const tenderTree = createNewPathTree('gather', treeSetting);
|
|
|
|
|
|
function setChildrenNode(node, files, tenders) {
|
|
|
- const children = _.filter(files, { parentID: node.pid });
|
|
|
- const tenderChildren = _.filter(tenders, { parentID: node.pid });
|
|
|
+ const children = _.filter(files, {parentID: node.pid});
|
|
|
+ const tenderChildren = _.filter(tenders, {parentID: node.pid});
|
|
|
const checkChildren = _.orderBy([...children, ...tenderChildren], ['seq', 'asc']);
|
|
|
for (const c of checkChildren) {
|
|
|
// if (c.type === 1 && _.filter(files, { parentID: c.ID }).length === 0 && _.filter(tenders, { parentID: c.ID }).length === 0) {
|
|
@@ -3786,19 +3834,19 @@ $(document).ready(() => {
|
|
|
parentID: c.parentID,
|
|
|
name: c.name,
|
|
|
type: c.type,
|
|
|
- selected: _.findIndex(gsObj.grArray, { pid: c.ID }) >= 0
|
|
|
+ selected: _.findIndex(gsObj.grArray, {pid: c.ID}) >= 0
|
|
|
};
|
|
|
tenderTree.addNode(child, node);
|
|
|
if (c.type === 1) setChildrenNode(child, files, tenders);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function convert (projects) {
|
|
|
+ function convert(projects) {
|
|
|
tenderTree.clearDatas();
|
|
|
const result = filterFolders(projects);
|
|
|
- const topLevel = _.orderBy(_.filter(result, { parentID: '-1' }), ['seq', 'asc']);
|
|
|
- const files = _.filter(result, { type: 1 });
|
|
|
- const tenders = _.filter(result, { type: 2 });
|
|
|
+ const topLevel = _.orderBy(_.filter(result, {parentID: '-1'}), ['seq', 'asc']);
|
|
|
+ const files = _.filter(result, {type: 1});
|
|
|
+ const tenders = _.filter(result, {type: 2});
|
|
|
|
|
|
for (const t of topLevel) {
|
|
|
const node = {
|
|
@@ -3806,7 +3854,7 @@ $(document).ready(() => {
|
|
|
parentID: t.parentID,
|
|
|
name: t.name,
|
|
|
type: t.type,
|
|
|
- selected: t.type === 2 ? _.findIndex(gsObj.grArray, { pid: t.ID }) >= 0 : false,
|
|
|
+ selected: t.type === 2 ? _.findIndex(gsObj.grArray, {pid: t.ID}) >= 0 : false,
|
|
|
};
|
|
|
tenderTree.addNode(node, null);
|
|
|
if (t.type === 1) setChildrenNode(node, files, tenders);
|
|
@@ -3814,7 +3862,8 @@ $(document).ready(() => {
|
|
|
tenderTree.sortTreeNode(true);
|
|
|
return tenderTree;
|
|
|
}
|
|
|
- return { tenderTree, convert }
|
|
|
+
|
|
|
+ return {tenderTree, convert}
|
|
|
})();
|
|
|
|
|
|
function filterFolders(data) {
|
|
@@ -3864,7 +3913,11 @@ $(document).ready(() => {
|
|
|
}
|
|
|
|
|
|
$('#set-dsk-project').click(function () {
|
|
|
- postData('/profile/dsk/api', { type: 'save_projects', tid: window.location.pathname.split('/')[2], project_list: gsObj.grArray }, function (result) {
|
|
|
+ postData('/profile/dsk/api', {
|
|
|
+ type: 'save_projects',
|
|
|
+ tid: window.location.pathname.split('/')[2],
|
|
|
+ project_list: gsObj.grArray
|
|
|
+ }, function (result) {
|
|
|
// dskAccountData.select_project = result;
|
|
|
dskProjects = gsObj.grArray;
|
|
|
if (!dskAccountData.select_project || dskAccountData.select_project !== result) {
|
|
@@ -3888,6 +3941,7 @@ $(document).ready(() => {
|
|
|
$('#change-dsk-project').html(html);
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
});
|
|
|
// 编号排序,多重判断
|
|
|
function sortByCode(a, b, code = 'b_code') {
|