|  | @@ -4458,517 +4458,516 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |              }, 100);
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |      })('a[name=showLevel]', billsSheet);
 | 
	
		
			
				|  |  | -    if (openRevise) {
 | 
	
		
			
				|  |  | -        const dataChecker = DataChecker({
 | 
	
		
			
				|  |  | -            checkUrl: window.location.pathname + '/check',
 | 
	
		
			
				|  |  | -            completeData: function (data) {
 | 
	
		
			
				|  |  | -                pos.updateDatas({update: data.source.pos});
 | 
	
		
			
				|  |  | -                const loadResult = billsTree.loadPostData({update: data.source.bills});
 | 
	
		
			
				|  |  | -                billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
 | 
	
		
			
				|  |  | -                posSpreadObj.loadCurPosData();
 | 
	
		
			
				|  |  | -                for (const e of data.error) {
 | 
	
		
			
				|  |  | -                    e.serialNo = billsTree.getNodeIndex(billsTree.getItems(e.ledger_id)) + 1;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            },
 | 
	
		
			
				|  |  | -            errorList: errorList,
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        $('#ledger-check2').click(() => {
 | 
	
		
			
				|  |  | -            ledgerCheck2({
 | 
	
		
			
				|  |  | -                ledgerTree: billsTree,
 | 
	
		
			
				|  |  | -                ledgerPos: pos,
 | 
	
		
			
				|  |  | +    const dataChecker = DataChecker({
 | 
	
		
			
				|  |  | +        checkUrl: window.location.pathname + '/check',
 | 
	
		
			
				|  |  | +        completeData: function (data) {
 | 
	
		
			
				|  |  | +            pos.updateDatas({update: data.source.pos});
 | 
	
		
			
				|  |  | +            const loadResult = billsTree.loadPostData({update: data.source.bills});
 | 
	
		
			
				|  |  | +            billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
 | 
	
		
			
				|  |  | +            posSpreadObj.loadCurPosData();
 | 
	
		
			
				|  |  | +            for (const e of data.error) {
 | 
	
		
			
				|  |  | +                e.serialNo = billsTree.getNodeIndex(billsTree.getItems(e.ledger_id)) + 1;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        errorList: errorList,
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    $('#ledger-check2').click(() => {
 | 
	
		
			
				|  |  | +        ledgerCheck2({
 | 
	
		
			
				|  |  | +            ledgerTree: billsTree,
 | 
	
		
			
				|  |  | +            ledgerPos: pos,
 | 
	
		
			
				|  |  | +            checkList: checkList,
 | 
	
		
			
				|  |  | +            decimal: decimal,
 | 
	
		
			
				|  |  | +            checkOption: checkOption,
 | 
	
		
			
				|  |  | +        }).then(result => {
 | 
	
		
			
				|  |  | +            check2Viewing({
 | 
	
		
			
				|  |  | +                extra: ZhCalc.div(billsTree.datas.length + pos.datas.length, 10000, 0),
 | 
	
		
			
				|  |  | +                randomWait: true,
 | 
	
		
			
				|  |  | +                prefix: 'check2-',
 | 
	
		
			
				|  |  | +                checks: result,
 | 
	
		
			
				|  |  |                  checkList: checkList,
 | 
	
		
			
				|  |  | -                decimal: decimal,
 | 
	
		
			
				|  |  | -                checkOption: checkOption,
 | 
	
		
			
				|  |  | -            }).then(result => {
 | 
	
		
			
				|  |  | -                check2Viewing({
 | 
	
		
			
				|  |  | -                    extra: ZhCalc.div(billsTree.datas.length + pos.datas.length, 10000, 0),
 | 
	
		
			
				|  |  | -                    randomWait: true,
 | 
	
		
			
				|  |  | -                    prefix: 'check2-',
 | 
	
		
			
				|  |  | -                    checks: result,
 | 
	
		
			
				|  |  | -                    checkList: checkList,
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -        if (isYb) {
 | 
	
		
			
				|  |  | -            let compilationList = [];
 | 
	
		
			
				|  |  | -            $('#get-dsk-btn').click(function () {
 | 
	
		
			
				|  |  | -                // 判断是否已绑定dsk用户
 | 
	
		
			
				|  |  | -                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();
 | 
	
		
			
				|  |  | -                        $('#error-dsk').modal('show');
 | 
	
		
			
				|  |  | -                        $('#error-dsk .modal-footer').find('a').eq(0).text('绑定手机');
 | 
	
		
			
				|  |  | -                    } else if (result === 2) {
 | 
	
		
			
				|  |  | -                        $('#error-dsk .modal-body').find('h5').eq(1).show();
 | 
	
		
			
				|  |  | -                        $('#error-dsk .modal-body').find('h5').eq(0).hide();
 | 
	
		
			
				|  |  | -                        $('#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) {
 | 
	
		
			
				|  |  | -                            let html = '';
 | 
	
		
			
				|  |  | -                            for (const data of result.compilation) {
 | 
	
		
			
				|  |  | -                                if (data.ID !== '5c66649650da2d000d8d37ba' && data.ID !== '5b52b027fd3bb0000b257cf8') {
 | 
	
		
			
				|  |  | -                                    html += `<option value="${data.ID}" ${result.select_compilation === data.ID ? 'selected' : ''}>${data.name}</option>`;
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    if (isYb) {
 | 
	
		
			
				|  |  | +        let compilationList = [];
 | 
	
		
			
				|  |  | +        $('#get-dsk-btn').click(function () {
 | 
	
		
			
				|  |  | +            // 判断是否已绑定dsk用户
 | 
	
		
			
				|  |  | +            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();
 | 
	
		
			
				|  |  | +                    $('#error-dsk').modal('show');
 | 
	
		
			
				|  |  | +                    $('#error-dsk .modal-footer').find('a').eq(0).text('绑定手机');
 | 
	
		
			
				|  |  | +                } else if (result === 2) {
 | 
	
		
			
				|  |  | +                    $('#error-dsk .modal-body').find('h5').eq(1).show();
 | 
	
		
			
				|  |  | +                    $('#error-dsk .modal-body').find('h5').eq(0).hide();
 | 
	
		
			
				|  |  | +                    $('#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) {
 | 
	
		
			
				|  |  | +                        let html = '';
 | 
	
		
			
				|  |  | +                        for (const data of result.compilation) {
 | 
	
		
			
				|  |  | +                            if (data.ID !== '5c66649650da2d000d8d37ba' && data.ID !== '5b52b027fd3bb0000b257cf8') {
 | 
	
		
			
				|  |  | +                                html += `<option value="${data.ID}" ${result.select_compilation === data.ID ? 'selected' : ''}>${data.name}</option>`;
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -                            dskAccountData = result.dskAccountData;
 | 
	
		
			
				|  |  | -                            compilationList = result.compilation;
 | 
	
		
			
				|  |  | -                            console.log(compilationList);
 | 
	
		
			
				|  |  | -                            $('#dsk-compilation-list').html(html);
 | 
	
		
			
				|  |  | -                            $('#add-dsk').modal('show');
 | 
	
		
			
				|  |  | -                            setLocalCache(dskCompilation, result.select_compilation);
 | 
	
		
			
				|  |  | -                            makeDskProjectSjsHtml(result.project);
 | 
	
		
			
				|  |  | -                        });
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                })
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            $('#get-dsk-bills-btn').click(function () {
 | 
	
		
			
				|  |  | -                const projectInfo = _.find(dskProjects, {pid: dskAccountData.select_project ? dskAccountData.select_project : null});
 | 
	
		
			
				|  |  | -                changeDskProjectTree(projectInfo, dskAccountData.select_tree ? dskAccountData.select_tree : null);
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        dskAccountData = result.dskAccountData;
 | 
	
		
			
				|  |  | +                        compilationList = result.compilation;
 | 
	
		
			
				|  |  | +                        console.log(compilationList);
 | 
	
		
			
				|  |  | +                        $('#dsk-compilation-list').html(html);
 | 
	
		
			
				|  |  | +                        $('#add-dsk').modal('show');
 | 
	
		
			
				|  |  | +                        setLocalCache(dskCompilation, result.select_compilation);
 | 
	
		
			
				|  |  | +                        makeDskProjectSjsHtml(result.project);
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        $('#get-dsk-bills-btn').click(function () {
 | 
	
		
			
				|  |  | +            const projectInfo = _.find(dskProjects, {pid: dskAccountData.select_project ? dskAccountData.select_project : null});
 | 
	
		
			
				|  |  | +            changeDskProjectTree(projectInfo, dskAccountData.select_tree ? dskAccountData.select_tree : null);
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            $('body').on('change', '#dsk-compilation-list', function () {
 | 
	
		
			
				|  |  | -                const compilationId = $(this).val();
 | 
	
		
			
				|  |  | -                setLocalCache(dskCompilation, compilationId);
 | 
	
		
			
				|  |  | -                dskProjectSpreadObj.refreshSourceTree();
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | +        $('body').on('change', '#dsk-compilation-list', function () {
 | 
	
		
			
				|  |  | +            const compilationId = $(this).val();
 | 
	
		
			
				|  |  | +            setLocalCache(dskCompilation, compilationId);
 | 
	
		
			
				|  |  | +            dskProjectSpreadObj.refreshSourceTree();
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            $('.hide-dsk-modal').click(function () {
 | 
	
		
			
				|  |  | -                $('#error-dsk').modal('hide');
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            let dp = false;
 | 
	
		
			
				|  |  | -            let gsObj = {
 | 
	
		
			
				|  |  | -                setting: null,
 | 
	
		
			
				|  |  | +        $('.hide-dsk-modal').click(function () {
 | 
	
		
			
				|  |  | +            $('#error-dsk').modal('hide');
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        let dp = false;
 | 
	
		
			
				|  |  | +        let gsObj = {
 | 
	
		
			
				|  |  | +            setting: null,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                gsSheet: null,
 | 
	
		
			
				|  |  | -                grSheet: null,
 | 
	
		
			
				|  |  | +            gsSheet: null,
 | 
	
		
			
				|  |  | +            grSheet: null,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                tenderSourceTree: null,
 | 
	
		
			
				|  |  | -                grArray: dskProjects ? dskProjects : [],
 | 
	
		
			
				|  |  | -                orgSelect: null,
 | 
	
		
			
				|  |  | -            };
 | 
	
		
			
				|  |  | +            tenderSourceTree: null,
 | 
	
		
			
				|  |  | +            grArray: dskProjects ? dskProjects : [],
 | 
	
		
			
				|  |  | +            orgSelect: null,
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            function makeDskProjectSjsHtml(datas) {
 | 
	
		
			
				|  |  | -                if (!dp) {
 | 
	
		
			
				|  |  | -                    initDskProjectTree();
 | 
	
		
			
				|  |  | -                    dp = true;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                gsObj.tenderSourceTree = dskProject2Tree.convert(datas);
 | 
	
		
			
				|  |  | -                SpreadJsObj.loadSheetData(gsObj.gsSheet, SpreadJsObj.DataType.Tree, gsObj.tenderSourceTree);
 | 
	
		
			
				|  |  | -                SpreadJsObj.loadSheetData(gsObj.grSheet, SpreadJsObj.DataType.Data, gsObj.grArray);
 | 
	
		
			
				|  |  | -                if (datas.length === 0) {
 | 
	
		
			
				|  |  | -                    $('#show-project-0').show();
 | 
	
		
			
				|  |  | -                } else {
 | 
	
		
			
				|  |  | -                    $('#show-project-0').hide();
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | +        function makeDskProjectSjsHtml(datas) {
 | 
	
		
			
				|  |  | +            if (!dp) {
 | 
	
		
			
				|  |  | +                initDskProjectTree();
 | 
	
		
			
				|  |  | +                dp = true;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            gsObj.tenderSourceTree = dskProject2Tree.convert(datas);
 | 
	
		
			
				|  |  | +            SpreadJsObj.loadSheetData(gsObj.gsSheet, SpreadJsObj.DataType.Tree, gsObj.tenderSourceTree);
 | 
	
		
			
				|  |  | +            SpreadJsObj.loadSheetData(gsObj.grSheet, SpreadJsObj.DataType.Data, gsObj.grArray);
 | 
	
		
			
				|  |  | +            if (datas.length === 0) {
 | 
	
		
			
				|  |  | +                $('#show-project-0').show();
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                $('#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
 | 
	
		
			
				|  |  | -                    };
 | 
	
		
			
				|  |  | -                    if (!gr) gsObj.grArray.push(t);
 | 
	
		
			
				|  |  | -                    return t;
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | -                _removeTender: function (tender) {
 | 
	
		
			
				|  |  | -                    const gri = gsObj.grArray.findIndex(function (x, i, arr) {
 | 
	
		
			
				|  |  | -                        return x.pid === tender.pid;
 | 
	
		
			
				|  |  | +        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
 | 
	
		
			
				|  |  | +                };
 | 
	
		
			
				|  |  | +                if (!gr) gsObj.grArray.push(t);
 | 
	
		
			
				|  |  | +                return t;
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            _removeTender: function (tender) {
 | 
	
		
			
				|  |  | +                const gri = gsObj.grArray.findIndex(function (x, i, arr) {
 | 
	
		
			
				|  |  | +                    return x.pid === tender.pid;
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +                if (gri >= 0) gsObj.grArray.splice(gri, 1);
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            reloadResultData: function () {
 | 
	
		
			
				|  |  | +                SpreadJsObj.reLoadSheetData(gsObj.grSheet);
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            refreshSourceTree: function () {
 | 
	
		
			
				|  |  | +                const c_id = getLocalCache(dskCompilation);
 | 
	
		
			
				|  |  | +                if (c_id) {
 | 
	
		
			
				|  |  | +                    postData('/profile/dsk/api', {type: 'project', compilationId: c_id}, function (result) {
 | 
	
		
			
				|  |  | +                        makeDskProjectSjsHtml(result);
 | 
	
		
			
				|  |  |                      });
 | 
	
		
			
				|  |  | -                    if (gri >= 0) gsObj.grArray.splice(gri, 1);
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | -                reloadResultData: function () {
 | 
	
		
			
				|  |  | -                    SpreadJsObj.reLoadSheetData(gsObj.grSheet);
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | -                refreshSourceTree: function () {
 | 
	
		
			
				|  |  | -                    const c_id = getLocalCache(dskCompilation);
 | 
	
		
			
				|  |  | -                    if (c_id) {
 | 
	
		
			
				|  |  | -                        postData('/profile/dsk/api', {type: 'project', compilationId: c_id}, function (result) {
 | 
	
		
			
				|  |  | -                            makeDskProjectSjsHtml(result);
 | 
	
		
			
				|  |  | -                        });
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | -                gsButtonClicked: function (e, info) {
 | 
	
		
			
				|  |  | -                    if (!info.sheet.zh_setting) return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            gsButtonClicked: function (e, info) {
 | 
	
		
			
				|  |  | +                if (!info.sheet.zh_setting) return;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    const col = info.sheet.zh_setting.cols[info.col];
 | 
	
		
			
				|  |  | -                    if (col.field !== 'selected') return;
 | 
	
		
			
				|  |  | +                const col = info.sheet.zh_setting.cols[info.col];
 | 
	
		
			
				|  |  | +                if (col.field !== 'selected') return;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    const node = SpreadJsObj.getSelectObject(info.sheet);
 | 
	
		
			
				|  |  | -                    node.selected = !node.selected;
 | 
	
		
			
				|  |  | -                    if (node.children && node.children.length > 0) {
 | 
	
		
			
				|  |  | -                        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.selected) {
 | 
	
		
			
				|  |  | -                                    dskProjectSpreadObj._addTender(p);
 | 
	
		
			
				|  |  | -                                } else {
 | 
	
		
			
				|  |  | -                                    dskProjectSpreadObj._removeTender(p);
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | +                const node = SpreadJsObj.getSelectObject(info.sheet);
 | 
	
		
			
				|  |  | +                node.selected = !node.selected;
 | 
	
		
			
				|  |  | +                if (node.children && node.children.length > 0) {
 | 
	
		
			
				|  |  | +                    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.selected) {
 | 
	
		
			
				|  |  | +                                dskProjectSpreadObj._addTender(p);
 | 
	
		
			
				|  |  | +                            } else {
 | 
	
		
			
				|  |  | +                                dskProjectSpreadObj._removeTender(p);
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        SpreadJsObj.reLoadRowData(info.sheet, info.row, posterity.length + 1);
 | 
	
		
			
				|  |  | -                    } else if (node.type === 2) {
 | 
	
		
			
				|  |  | -                        if (node.selected) {
 | 
	
		
			
				|  |  | -                            dskProjectSpreadObj._addTender(node);
 | 
	
		
			
				|  |  | -                        } else {
 | 
	
		
			
				|  |  | -                            dskProjectSpreadObj._removeTender(node);
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        SpreadJsObj.reLoadRowData(info.sheet, info.row, 1);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    dskProjectSpreadObj.reloadResultData();
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | -                deleteGr: function () {
 | 
	
		
			
				|  |  | -                    if (gsObj.grArray.length === 0) return;
 | 
	
		
			
				|  |  | -                    if (gsObj.grSheet.getSelections().length === 0) return;
 | 
	
		
			
				|  |  | -                    const selections = gsObj.grSheet.getSelections();
 | 
	
		
			
				|  |  | -                    const sel = selections ? selections[0] : gsObj.grSheet.getSelections()[0];
 | 
	
		
			
				|  |  | -                    const row = sel && sel.row !== undefined ? sel.row : -1;
 | 
	
		
			
				|  |  | -                    if (row === -1 || sel.row + sel.rowCount > gsObj.grArray.length) {
 | 
	
		
			
				|  |  | -                        return false;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    const delList = [];
 | 
	
		
			
				|  |  | -                    for (let r = 0; r < sel.rowCount; r++) {
 | 
	
		
			
				|  |  | -                        const select = gsObj.grArray[row + r];
 | 
	
		
			
				|  |  | -                        delList.push(select);
 | 
	
		
			
				|  |  | +                    SpreadJsObj.reLoadRowData(info.sheet, info.row, posterity.length + 1);
 | 
	
		
			
				|  |  | +                } else if (node.type === 2) {
 | 
	
		
			
				|  |  | +                    if (node.selected) {
 | 
	
		
			
				|  |  | +                        dskProjectSpreadObj._addTender(node);
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        dskProjectSpreadObj._removeTender(node);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    _.pullAll(gsObj.grArray, delList);
 | 
	
		
			
				|  |  | -                    dskProjectSpreadObj.reloadResultData();
 | 
	
		
			
				|  |  | -                    dskProjectSpreadObj.refreshSourceTree();
 | 
	
		
			
				|  |  | -                },
 | 
	
		
			
				|  |  | +                    SpreadJsObj.reLoadRowData(info.sheet, info.row, 1);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                dskProjectSpreadObj.reloadResultData();
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            deleteGr: function () {
 | 
	
		
			
				|  |  | +                if (gsObj.grArray.length === 0) return;
 | 
	
		
			
				|  |  | +                if (gsObj.grSheet.getSelections().length === 0) return;
 | 
	
		
			
				|  |  | +                const selections = gsObj.grSheet.getSelections();
 | 
	
		
			
				|  |  | +                const sel = selections ? selections[0] : gsObj.grSheet.getSelections()[0];
 | 
	
		
			
				|  |  | +                const row = sel && sel.row !== undefined ? sel.row : -1;
 | 
	
		
			
				|  |  | +                if (row === -1 || sel.row + sel.rowCount > gsObj.grArray.length) {
 | 
	
		
			
				|  |  | +                    return false;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                const delList = [];
 | 
	
		
			
				|  |  | +                for (let r = 0; r < sel.rowCount; r++) {
 | 
	
		
			
				|  |  | +                    const select = gsObj.grArray[row + r];
 | 
	
		
			
				|  |  | +                    delList.push(select);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                _.pullAll(gsObj.grArray, delList);
 | 
	
		
			
				|  |  | +                dskProjectSpreadObj.reloadResultData();
 | 
	
		
			
				|  |  | +                dskProjectSpreadObj.refreshSourceTree();
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        const initDskProjectTree = function () {
 | 
	
		
			
				|  |  | +            const gsSpread = SpreadJsObj.createNewSpread($('#dsk-project-source-spread')[0]);
 | 
	
		
			
				|  |  | +            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'
 | 
	
		
			
				|  |  | +                    },
 | 
	
		
			
				|  |  | +                ],
 | 
	
		
			
				|  |  | +                emptyRows: 0,
 | 
	
		
			
				|  |  | +                headRows: 1,
 | 
	
		
			
				|  |  | +                headRowHeight: [32],
 | 
	
		
			
				|  |  | +                defaultRowHeight: 21,
 | 
	
		
			
				|  |  | +                headerFont: '12px 微软雅黑',
 | 
	
		
			
				|  |  | +                font: '12px 微软雅黑',
 | 
	
		
			
				|  |  | +                headColWidth: [0],
 | 
	
		
			
				|  |  | +                selectedBackColor: '#fffacd',
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  | +            SpreadJsObj.initSheet(gsObj.gsSheet, gsSpreadSetting);
 | 
	
		
			
				|  |  | +            gsSpread.bind(spreadNS.Events.ButtonClicked, dskProjectSpreadObj.gsButtonClicked);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            const initDskProjectTree = function () {
 | 
	
		
			
				|  |  | -                const gsSpread = SpreadJsObj.createNewSpread($('#dsk-project-source-spread')[0]);
 | 
	
		
			
				|  |  | -                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'
 | 
	
		
			
				|  |  | -                        },
 | 
	
		
			
				|  |  | -                    ],
 | 
	
		
			
				|  |  | -                    emptyRows: 0,
 | 
	
		
			
				|  |  | -                    headRows: 1,
 | 
	
		
			
				|  |  | -                    headRowHeight: [32],
 | 
	
		
			
				|  |  | -                    defaultRowHeight: 21,
 | 
	
		
			
				|  |  | -                    headerFont: '12px 微软雅黑',
 | 
	
		
			
				|  |  | -                    font: '12px 微软雅黑',
 | 
	
		
			
				|  |  | -                    headColWidth: [0],
 | 
	
		
			
				|  |  | -                    selectedBackColor: '#fffacd',
 | 
	
		
			
				|  |  | -                };
 | 
	
		
			
				|  |  | -                SpreadJsObj.initSheet(gsObj.gsSheet, gsSpreadSetting);
 | 
	
		
			
				|  |  | -                gsSpread.bind(spreadNS.Events.ButtonClicked, dskProjectSpreadObj.gsButtonClicked);
 | 
	
		
			
				|  |  | +            const grSpread = SpreadJsObj.createNewSpread($('#dsk-project-result-spread')[0]);
 | 
	
		
			
				|  |  | +            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
 | 
	
		
			
				|  |  | +                    },
 | 
	
		
			
				|  |  | +                ],
 | 
	
		
			
				|  |  | +                emptyRows: 0,
 | 
	
		
			
				|  |  | +                headRows: 1,
 | 
	
		
			
				|  |  | +                headRowHeight: [32],
 | 
	
		
			
				|  |  | +                defaultRowHeight: 21,
 | 
	
		
			
				|  |  | +                headerFont: '12px 微软雅黑',
 | 
	
		
			
				|  |  | +                font: '12px 微软雅黑',
 | 
	
		
			
				|  |  | +                headColWidth: []
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  | +            SpreadJsObj.initSheet(gsObj.grSheet, grSpreadSetting);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                const grSpread = SpreadJsObj.createNewSpread($('#dsk-project-result-spread')[0]);
 | 
	
		
			
				|  |  | -                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
 | 
	
		
			
				|  |  | +            // 右键删除已选项目
 | 
	
		
			
				|  |  | +            const gsContextMenuOptions = {
 | 
	
		
			
				|  |  | +                selector: '#dsk-project-result-spread',
 | 
	
		
			
				|  |  | +                build: function ($trigger, e) {
 | 
	
		
			
				|  |  | +                    const target = SpreadJsObj.safeRightClickSelection($trigger, e, grSpread);
 | 
	
		
			
				|  |  | +                    return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
 | 
	
		
			
				|  |  | +                },
 | 
	
		
			
				|  |  | +                items: {
 | 
	
		
			
				|  |  | +                    delete: {
 | 
	
		
			
				|  |  | +                        name: '删除',
 | 
	
		
			
				|  |  | +                        icon: 'fa-remove',
 | 
	
		
			
				|  |  | +                        callback: function (key, opt) {
 | 
	
		
			
				|  |  | +                            dskProjectSpreadObj.deleteGr();
 | 
	
		
			
				|  |  |                          },
 | 
	
		
			
				|  |  | -                    ],
 | 
	
		
			
				|  |  | -                    emptyRows: 0,
 | 
	
		
			
				|  |  | -                    headRows: 1,
 | 
	
		
			
				|  |  | -                    headRowHeight: [32],
 | 
	
		
			
				|  |  | -                    defaultRowHeight: 21,
 | 
	
		
			
				|  |  | -                    headerFont: '12px 微软雅黑',
 | 
	
		
			
				|  |  | -                    font: '12px 微软雅黑',
 | 
	
		
			
				|  |  | -                    headColWidth: []
 | 
	
		
			
				|  |  | -                };
 | 
	
		
			
				|  |  | -                SpreadJsObj.initSheet(gsObj.grSheet, grSpreadSetting);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                // 右键删除已选项目
 | 
	
		
			
				|  |  | -                const gsContextMenuOptions = {
 | 
	
		
			
				|  |  | -                    selector: '#dsk-project-result-spread',
 | 
	
		
			
				|  |  | -                    build: function ($trigger, e) {
 | 
	
		
			
				|  |  | -                        const target = SpreadJsObj.safeRightClickSelection($trigger, e, grSpread);
 | 
	
		
			
				|  |  | -                        return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
 | 
	
		
			
				|  |  | -                    },
 | 
	
		
			
				|  |  | -                    items: {
 | 
	
		
			
				|  |  | -                        delete: {
 | 
	
		
			
				|  |  | -                            name: '删除',
 | 
	
		
			
				|  |  | -                            icon: 'fa-remove',
 | 
	
		
			
				|  |  | -                            callback: function (key, opt) {
 | 
	
		
			
				|  |  | -                                dskProjectSpreadObj.deleteGr();
 | 
	
		
			
				|  |  | -                            },
 | 
	
		
			
				|  |  | -                            disabled: function (key, opt) {
 | 
	
		
			
				|  |  | -                                const selection = gsObj.grSheet.getSelections();
 | 
	
		
			
				|  |  | -                                const sel = selection ? selection[0] : gsObj.grSheet.getSelections()[0];
 | 
	
		
			
				|  |  | -                                const row = sel && sel.row !== undefined ? sel.row : -1;
 | 
	
		
			
				|  |  | -                                if (row === -1 || sel.row + sel.rowCount > gsObj.grArray.length) {
 | 
	
		
			
				|  |  | -                                    return true;
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                                return false;
 | 
	
		
			
				|  |  | +                        disabled: function (key, opt) {
 | 
	
		
			
				|  |  | +                            const selection = gsObj.grSheet.getSelections();
 | 
	
		
			
				|  |  | +                            const sel = selection ? selection[0] : gsObj.grSheet.getSelections()[0];
 | 
	
		
			
				|  |  | +                            const row = sel && sel.row !== undefined ? sel.row : -1;
 | 
	
		
			
				|  |  | +                            if (row === -1 || sel.row + sel.rowCount > gsObj.grArray.length) {
 | 
	
		
			
				|  |  | +                                return true;
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -                        },
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                };
 | 
	
		
			
				|  |  | -                $.contextMenu(gsContextMenuOptions);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                $('#add-dsk').bind('shown.bs.modal', function () {
 | 
	
		
			
				|  |  | -                    if (gsSpread) gsSpread.refresh();
 | 
	
		
			
				|  |  | -                    if (grSpread) grSpread.refresh();
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | +                            return false;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    },
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  | +            $.contextMenu(gsContextMenuOptions);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            const dskProject2Tree = (function () {
 | 
	
		
			
				|  |  | -                const treeSetting = {
 | 
	
		
			
				|  |  | -                    id: 'tmt_id',
 | 
	
		
			
				|  |  | -                    pid: 'tmt_pid',
 | 
	
		
			
				|  |  | -                    order: 'seq',
 | 
	
		
			
				|  |  | -                    level: 'level',
 | 
	
		
			
				|  |  | -                    rootId: '-1',
 | 
	
		
			
				|  |  | -                    fullPath: 'full_path',
 | 
	
		
			
				|  |  | -                };
 | 
	
		
			
				|  |  | -                const tenderTree = createNewPathTree('gather', treeSetting);
 | 
	
		
			
				|  |  | +            $('#add-dsk').bind('shown.bs.modal', function () {
 | 
	
		
			
				|  |  | +                if (gsSpread) gsSpread.refresh();
 | 
	
		
			
				|  |  | +                if (grSpread) grSpread.refresh();
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                function setChildrenNode(node, files, tenders) {
 | 
	
		
			
				|  |  | -                    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) {
 | 
	
		
			
				|  |  | -                        //     // 判断文件夹下有无东西,没有就不插入
 | 
	
		
			
				|  |  | -                        //     continue;
 | 
	
		
			
				|  |  | -                        // }
 | 
	
		
			
				|  |  | -                        const child = {
 | 
	
		
			
				|  |  | -                            pid: c.ID,
 | 
	
		
			
				|  |  | -                            parentID: c.parentID,
 | 
	
		
			
				|  |  | -                            name: c.name,
 | 
	
		
			
				|  |  | -                            type: c.type,
 | 
	
		
			
				|  |  | -                            selected: _.findIndex(gsObj.grArray, {pid: c.ID}) >= 0
 | 
	
		
			
				|  |  | -                        };
 | 
	
		
			
				|  |  | -                        tenderTree.addNode(child, node);
 | 
	
		
			
				|  |  | -                        if (c.type === 1) setChildrenNode(child, files, tenders);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +        const dskProject2Tree = (function () {
 | 
	
		
			
				|  |  | +            const treeSetting = {
 | 
	
		
			
				|  |  | +                id: 'tmt_id',
 | 
	
		
			
				|  |  | +                pid: 'tmt_pid',
 | 
	
		
			
				|  |  | +                order: 'seq',
 | 
	
		
			
				|  |  | +                level: 'level',
 | 
	
		
			
				|  |  | +                rootId: '-1',
 | 
	
		
			
				|  |  | +                fullPath: 'full_path',
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  | +            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 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) {
 | 
	
		
			
				|  |  | +                    //     // 判断文件夹下有无东西,没有就不插入
 | 
	
		
			
				|  |  | +                    //     continue;
 | 
	
		
			
				|  |  | +                    // }
 | 
	
		
			
				|  |  | +                    const child = {
 | 
	
		
			
				|  |  | +                        pid: c.ID,
 | 
	
		
			
				|  |  | +                        parentID: c.parentID,
 | 
	
		
			
				|  |  | +                        name: c.name,
 | 
	
		
			
				|  |  | +                        type: c.type,
 | 
	
		
			
				|  |  | +                        selected: _.findIndex(gsObj.grArray, {pid: c.ID}) >= 0
 | 
	
		
			
				|  |  | +                    };
 | 
	
		
			
				|  |  | +                    tenderTree.addNode(child, node);
 | 
	
		
			
				|  |  | +                    if (c.type === 1) setChildrenNode(child, files, tenders);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                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});
 | 
	
		
			
				|  |  | +            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});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    for (const t of topLevel) {
 | 
	
		
			
				|  |  | -                        const node = {
 | 
	
		
			
				|  |  | -                            pid: t.ID,
 | 
	
		
			
				|  |  | -                            parentID: t.parentID,
 | 
	
		
			
				|  |  | -                            name: t.name,
 | 
	
		
			
				|  |  | -                            type: t.type,
 | 
	
		
			
				|  |  | -                            selected: t.type === 2 ? _.findIndex(gsObj.grArray, {pid: t.ID}) >= 0 : false,
 | 
	
		
			
				|  |  | -                        };
 | 
	
		
			
				|  |  | -                        tenderTree.addNode(node, null);
 | 
	
		
			
				|  |  | -                        if (t.type === 1) setChildrenNode(node, files, tenders);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    tenderTree.sortTreeNode(true);
 | 
	
		
			
				|  |  | -                    return tenderTree;
 | 
	
		
			
				|  |  | +                for (const t of topLevel) {
 | 
	
		
			
				|  |  | +                    const node = {
 | 
	
		
			
				|  |  | +                        pid: t.ID,
 | 
	
		
			
				|  |  | +                        parentID: t.parentID,
 | 
	
		
			
				|  |  | +                        name: t.name,
 | 
	
		
			
				|  |  | +                        type: t.type,
 | 
	
		
			
				|  |  | +                        selected: t.type === 2 ? _.findIndex(gsObj.grArray, {pid: t.ID}) >= 0 : false,
 | 
	
		
			
				|  |  | +                    };
 | 
	
		
			
				|  |  | +                    tenderTree.addNode(node, null);
 | 
	
		
			
				|  |  | +                    if (t.type === 1) setChildrenNode(node, files, tenders);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +                tenderTree.sortTreeNode(true);
 | 
	
		
			
				|  |  | +                return tenderTree;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                return {tenderTree, convert}
 | 
	
		
			
				|  |  | -            })();
 | 
	
		
			
				|  |  | +            return {tenderTree, convert}
 | 
	
		
			
				|  |  | +        })();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            function filterFolders(data) {
 | 
	
		
			
				|  |  | -                // 构建ID到节点的映射
 | 
	
		
			
				|  |  | -                const idMap = data.reduce((map, node) => {
 | 
	
		
			
				|  |  | -                    map[node.ID] = node;
 | 
	
		
			
				|  |  | -                    return map;
 | 
	
		
			
				|  |  | -                }, {});
 | 
	
		
			
				|  |  | +        function filterFolders(data) {
 | 
	
		
			
				|  |  | +            // 构建ID到节点的映射
 | 
	
		
			
				|  |  | +            const idMap = data.reduce((map, node) => {
 | 
	
		
			
				|  |  | +                map[node.ID] = node;
 | 
	
		
			
				|  |  | +                return map;
 | 
	
		
			
				|  |  | +            }, {});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                // 建立父子关系映射
 | 
	
		
			
				|  |  | -                const parentMap = data.reduce((map, node) => {
 | 
	
		
			
				|  |  | -                    if (node.parentID !== '-1') {
 | 
	
		
			
				|  |  | -                        if (!map[node.parentID]) {
 | 
	
		
			
				|  |  | -                            map[node.parentID] = [];
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        map[node.parentID].push(node.ID);
 | 
	
		
			
				|  |  | +            // 建立父子关系映射
 | 
	
		
			
				|  |  | +            const parentMap = data.reduce((map, node) => {
 | 
	
		
			
				|  |  | +                if (node.parentID !== '-1') {
 | 
	
		
			
				|  |  | +                    if (!map[node.parentID]) {
 | 
	
		
			
				|  |  | +                        map[node.parentID] = [];
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    return map;
 | 
	
		
			
				|  |  | -                }, {});
 | 
	
		
			
				|  |  | +                    map[node.parentID].push(node.ID);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return map;
 | 
	
		
			
				|  |  | +            }, {});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                // 检查节点及其子节点是否包含清单(type=1)
 | 
	
		
			
				|  |  | -                const hasChecklist = (id) => {
 | 
	
		
			
				|  |  | -                    const node = idMap[id];
 | 
	
		
			
				|  |  | -                    if (node.type === 2) {
 | 
	
		
			
				|  |  | -                        return true;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    if (!parentMap[id]) {
 | 
	
		
			
				|  |  | -                        return false;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    return parentMap[id].some(childID => hasChecklist(childID));
 | 
	
		
			
				|  |  | -                };
 | 
	
		
			
				|  |  | +            // 检查节点及其子节点是否包含清单(type=1)
 | 
	
		
			
				|  |  | +            const hasChecklist = (id) => {
 | 
	
		
			
				|  |  | +                const node = idMap[id];
 | 
	
		
			
				|  |  | +                if (node.type === 2) {
 | 
	
		
			
				|  |  | +                    return true;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (!parentMap[id]) {
 | 
	
		
			
				|  |  | +                    return false;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return parentMap[id].some(childID => hasChecklist(childID));
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                // 过滤节点
 | 
	
		
			
				|  |  | -                const filteredIDs = new Set();
 | 
	
		
			
				|  |  | -                data.forEach(node => {
 | 
	
		
			
				|  |  | -                    if (node.type === 2 || hasChecklist(node.ID)) {
 | 
	
		
			
				|  |  | -                        let currentID = node.ID;
 | 
	
		
			
				|  |  | -                        while (currentID !== '-1') {
 | 
	
		
			
				|  |  | -                            filteredIDs.add(currentID);
 | 
	
		
			
				|  |  | -                            currentID = idMap[currentID].parentID;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | +            // 过滤节点
 | 
	
		
			
				|  |  | +            const filteredIDs = new Set();
 | 
	
		
			
				|  |  | +            data.forEach(node => {
 | 
	
		
			
				|  |  | +                if (node.type === 2 || hasChecklist(node.ID)) {
 | 
	
		
			
				|  |  | +                    let currentID = node.ID;
 | 
	
		
			
				|  |  | +                    while (currentID !== '-1') {
 | 
	
		
			
				|  |  | +                        filteredIDs.add(currentID);
 | 
	
		
			
				|  |  | +                        currentID = idMap[currentID].parentID;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                // 返回过滤后的数据
 | 
	
		
			
				|  |  | -                return data.filter(node => filteredIDs.has(node.ID));
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +            // 返回过滤后的数据
 | 
	
		
			
				|  |  | +            return data.filter(node => filteredIDs.has(node.ID));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            $('#set-dsk-project').click(function () {
 | 
	
		
			
				|  |  | -                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) {
 | 
	
		
			
				|  |  | -                        dskAccountData.select_project = result;
 | 
	
		
			
				|  |  | -                        changeDskProject(result);
 | 
	
		
			
				|  |  | -                        dskBills.spread.refresh();
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    setDskProjectSelect(gsObj.grArray);
 | 
	
		
			
				|  |  | -                    $('#add-dsk').modal('hide');
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -            $('#add-dsk').on('hide.bs.modal', function () {
 | 
	
		
			
				|  |  | -                $('#autoTip').hide();
 | 
	
		
			
				|  |  | +        $('#set-dsk-project').click(function () {
 | 
	
		
			
				|  |  | +            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) {
 | 
	
		
			
				|  |  | +                    dskAccountData.select_project = result;
 | 
	
		
			
				|  |  | +                    changeDskProject(result);
 | 
	
		
			
				|  |  | +                    dskBills.spread.refresh();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                setDskProjectSelect(gsObj.grArray);
 | 
	
		
			
				|  |  | +                $('#add-dsk').modal('hide');
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        $('#add-dsk').on('hide.bs.modal', function () {
 | 
	
		
			
				|  |  | +            $('#autoTip').hide();
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            function setDskProjectSelect(projects) {
 | 
	
		
			
				|  |  | -                let html = '';
 | 
	
		
			
				|  |  | -                for (const project of projects) {
 | 
	
		
			
				|  |  | -                    html += `<option value="${project.pid}" ${project.pid === dskAccountData.select_project ? 'selected' : ''}>${project.name}</option>`;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                $('#change-dsk-project').html(html);
 | 
	
		
			
				|  |  | +        function setDskProjectSelect(projects) {
 | 
	
		
			
				|  |  | +            let html = '';
 | 
	
		
			
				|  |  | +            for (const project of projects) {
 | 
	
		
			
				|  |  | +                html += `<option value="${project.pid}" ${project.pid === dskAccountData.select_project ? 'selected' : ''}>${project.name}</option>`;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            $('#change-dsk-project').html(html);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            // 选中所有新增部位/清单
 | 
	
		
			
				|  |  | -            $('#add-all-revise').click(function() {
 | 
	
		
			
				|  |  | -                const this_cid = window.location.pathname.split('/')[4];
 | 
	
		
			
				|  |  | -                makeGclGatherData();
 | 
	
		
			
				|  |  | -                postData('/tender/' + window.location.pathname.split('/')[2] + '/change/' + window.location.pathname.split('/')[4] + '/information/save', {
 | 
	
		
			
				|  |  | -                    type: 'get-revise-list',
 | 
	
		
			
				|  |  | -                }, function (result) {
 | 
	
		
			
				|  |  | -                    const addDatas = [];
 | 
	
		
			
				|  |  | -                    for (const ggd in gclGatherData) {
 | 
	
		
			
				|  |  | -                        gclGatherData[ggd].code = gclGatherData[ggd].b_code;
 | 
	
		
			
				|  |  | -                        let hadcid = 0;
 | 
	
		
			
				|  |  | -                        for (const xmj of gclGatherData[ggd].leafXmjs) {
 | 
	
		
			
				|  |  | -                            const changeLedger = _.find(result.changeLedgerList, {id: xmj.gcl_id});
 | 
	
		
			
				|  |  | -                            const changePos = _.find(result.changePosList, {id: xmj.mx_id, lid: xmj.gcl_id});
 | 
	
		
			
				|  |  | -                            if (changeLedger || changePos) {
 | 
	
		
			
				|  |  | -                                xmj.cid = 1;
 | 
	
		
			
				|  |  | -                                xmj.ccid = changePos ? changePos.ccid : changeLedger ? changeLedger.ccid : 0;
 | 
	
		
			
				|  |  | -                                hadcid = 1;
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | +        // 选中所有新增部位/清单
 | 
	
		
			
				|  |  | +        $('#add-all-revise').click(function() {
 | 
	
		
			
				|  |  | +            const this_cid = window.location.pathname.split('/')[4];
 | 
	
		
			
				|  |  | +            makeGclGatherData();
 | 
	
		
			
				|  |  | +            postData('/tender/' + window.location.pathname.split('/')[2] + '/change/' + window.location.pathname.split('/')[4] + '/information/save', {
 | 
	
		
			
				|  |  | +                type: 'get-revise-list',
 | 
	
		
			
				|  |  | +            }, function (result) {
 | 
	
		
			
				|  |  | +                const addDatas = [];
 | 
	
		
			
				|  |  | +                for (const ggd in gclGatherData) {
 | 
	
		
			
				|  |  | +                    gclGatherData[ggd].code = gclGatherData[ggd].b_code;
 | 
	
		
			
				|  |  | +                    let hadcid = 0;
 | 
	
		
			
				|  |  | +                    for (const xmj of gclGatherData[ggd].leafXmjs) {
 | 
	
		
			
				|  |  | +                        const changeLedger = _.find(result.changeLedgerList, {id: xmj.gcl_id});
 | 
	
		
			
				|  |  | +                        const changePos = _.find(result.changePosList, {id: xmj.mx_id, lid: xmj.gcl_id});
 | 
	
		
			
				|  |  | +                        if (changeLedger || changePos) {
 | 
	
		
			
				|  |  | +                            xmj.cid = 1;
 | 
	
		
			
				|  |  | +                            xmj.ccid = changePos ? changePos.ccid : changeLedger ? changeLedger.ccid : 0;
 | 
	
		
			
				|  |  | +                            hadcid = 1;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        if (hadcid !== 0) gclGatherData[ggd].cid = 1;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    for (const gclInfo of _.filter(gclGatherData, {cid: 1})) {
 | 
	
		
			
				|  |  | -                        const leafXmjs = _.filter(gclInfo.leafXmjs, {ccid: this_cid});
 | 
	
		
			
				|  |  | -                        if (leafXmjs.length > 0) {
 | 
	
		
			
				|  |  | -                            gclInfo.is_change = 1;
 | 
	
		
			
				|  |  | -                            for (const xmj of leafXmjs) {
 | 
	
		
			
				|  |  | -                                if (_.findIndex(changeList, function (item) {
 | 
	
		
			
				|  |  | -                                    return item.gcl_id === xmj.gcl_id && item.mx_id === (xmj.mx_id || '');
 | 
	
		
			
				|  |  | -                                }) === -1) {
 | 
	
		
			
				|  |  | -                                    addDatas.push({
 | 
	
		
			
				|  |  | -                                        lid: xmj.gcl_id,
 | 
	
		
			
				|  |  | -                                        code: gclInfo.code,
 | 
	
		
			
				|  |  | -                                        name: gclInfo.name || '',
 | 
	
		
			
				|  |  | -                                        unit: gclInfo.unit || '',
 | 
	
		
			
				|  |  | -                                        unit_price: gclInfo.unit_price,
 | 
	
		
			
				|  |  | -                                        oamount: xmj.quantity,
 | 
	
		
			
				|  |  | -                                        oamount2: xmj.quantity,
 | 
	
		
			
				|  |  | -                                        bwmx: xmj.bwmx || xmj.jldy || '',
 | 
	
		
			
				|  |  | -                                        xmj_code: xmj.code || '',
 | 
	
		
			
				|  |  | -                                        xmj_jldy: xmj.jldy || '',
 | 
	
		
			
				|  |  | -                                        xmj_dwgc: xmj.dwgc || '',
 | 
	
		
			
				|  |  | -                                        xmj_fbgc: xmj.fbgc || '',
 | 
	
		
			
				|  |  | -                                        xmj_fxgc: xmj.fxgc || '',
 | 
	
		
			
				|  |  | -                                        gcl_id: xmj.gcl_id,
 | 
	
		
			
				|  |  | -                                        mx_id: xmj.mx_id || '',
 | 
	
		
			
				|  |  | -                                    });
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | +                    if (hadcid !== 0) gclGatherData[ggd].cid = 1;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                for (const gclInfo of _.filter(gclGatherData, {cid: 1})) {
 | 
	
		
			
				|  |  | +                    const leafXmjs = _.filter(gclInfo.leafXmjs, {ccid: this_cid});
 | 
	
		
			
				|  |  | +                    if (leafXmjs.length > 0) {
 | 
	
		
			
				|  |  | +                        gclInfo.is_change = 1;
 | 
	
		
			
				|  |  | +                        for (const xmj of leafXmjs) {
 | 
	
		
			
				|  |  | +                            if (_.findIndex(changeList, function (item) {
 | 
	
		
			
				|  |  | +                                return item.gcl_id === xmj.gcl_id && item.mx_id === (xmj.mx_id || '');
 | 
	
		
			
				|  |  | +                            }) === -1) {
 | 
	
		
			
				|  |  | +                                addDatas.push({
 | 
	
		
			
				|  |  | +                                    lid: xmj.gcl_id,
 | 
	
		
			
				|  |  | +                                    code: gclInfo.code,
 | 
	
		
			
				|  |  | +                                    name: gclInfo.name || '',
 | 
	
		
			
				|  |  | +                                    unit: gclInfo.unit || '',
 | 
	
		
			
				|  |  | +                                    unit_price: gclInfo.unit_price,
 | 
	
		
			
				|  |  | +                                    oamount: xmj.quantity,
 | 
	
		
			
				|  |  | +                                    oamount2: xmj.quantity,
 | 
	
		
			
				|  |  | +                                    bwmx: xmj.bwmx || xmj.jldy || '',
 | 
	
		
			
				|  |  | +                                    xmj_code: xmj.code || '',
 | 
	
		
			
				|  |  | +                                    xmj_jldy: xmj.jldy || '',
 | 
	
		
			
				|  |  | +                                    xmj_dwgc: xmj.dwgc || '',
 | 
	
		
			
				|  |  | +                                    xmj_fbgc: xmj.fbgc || '',
 | 
	
		
			
				|  |  | +                                    xmj_fxgc: xmj.fxgc || '',
 | 
	
		
			
				|  |  | +                                    gcl_id: xmj.gcl_id,
 | 
	
		
			
				|  |  | +                                    mx_id: xmj.mx_id || '',
 | 
	
		
			
				|  |  | +                                });
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    console.log(addDatas);
 | 
	
		
			
				|  |  | -                    if (addDatas.length > 0) {
 | 
	
		
			
				|  |  | -                        // 更新至服务器
 | 
	
		
			
				|  |  | -                        postData('/tender/' + window.location.pathname.split('/')[2] + '/change/' + window.location.pathname.split('/')[4] + '/information/save', {
 | 
	
		
			
				|  |  | -                            type: 'add-change-list',
 | 
	
		
			
				|  |  | -                            postData: addDatas,
 | 
	
		
			
				|  |  | -                        }, function (result) {
 | 
	
		
			
				|  |  | -                            toastr.success('已新增当前变更令新增的所有部位/清单');
 | 
	
		
			
				|  |  | -                            changeList = result.changeList;
 | 
	
		
			
				|  |  | -                            const sortData = SpreadJsObj.getSortData(billsSheet);
 | 
	
		
			
				|  |  | -                            const billsNodes = _.filter(sortData, function (item) {
 | 
	
		
			
				|  |  | -                                return _.findIndex(addDatas, {gcl_id: item.id}) !== -1;
 | 
	
		
			
				|  |  | -                            });
 | 
	
		
			
				|  |  | -                            for (const billsNode of billsNodes) {
 | 
	
		
			
				|  |  | -                                billsNode.is_change = 1;
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            const loadResult = { update: billsNodes };
 | 
	
		
			
				|  |  | -                            billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
 | 
	
		
			
				|  |  | -                            posSpreadObj.loadCurPosData();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                console.log(addDatas);
 | 
	
		
			
				|  |  | +                if (addDatas.length > 0) {
 | 
	
		
			
				|  |  | +                    // 更新至服务器
 | 
	
		
			
				|  |  | +                    postData('/tender/' + window.location.pathname.split('/')[2] + '/change/' + window.location.pathname.split('/')[4] + '/information/save', {
 | 
	
		
			
				|  |  | +                        type: 'add-change-list',
 | 
	
		
			
				|  |  | +                        postData: addDatas,
 | 
	
		
			
				|  |  | +                    }, function (result) {
 | 
	
		
			
				|  |  | +                        toastr.success('已新增当前变更令新增的所有部位/清单');
 | 
	
		
			
				|  |  | +                        changeList = result.changeList;
 | 
	
		
			
				|  |  | +                        const sortData = SpreadJsObj.getSortData(billsSheet);
 | 
	
		
			
				|  |  | +                        const billsNodes = _.filter(sortData, function (item) {
 | 
	
		
			
				|  |  | +                            return _.findIndex(addDatas, {gcl_id: item.id}) !== -1;
 | 
	
		
			
				|  |  |                          });
 | 
	
		
			
				|  |  | -                    } else {
 | 
	
		
			
				|  |  | -                        toastr.warning('未存在当前变更令新增的部位/清单');
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | +                        for (const billsNode of billsNodes) {
 | 
	
		
			
				|  |  | +                            billsNode.is_change = 1;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        const loadResult = { update: billsNodes };
 | 
	
		
			
				|  |  | +                        billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
 | 
	
		
			
				|  |  | +                        posSpreadObj.loadCurPosData();
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    toastr.warning('未存在当前变更令新增的部位/清单');
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  function findDecimal(unit) {
 |