Sfoglia il codice sorgente

变更修订判断修改

laiguoran 4 anni fa
parent
commit
577c330fb5

+ 4 - 1
app/controller/change_controller.js

@@ -714,7 +714,10 @@ module.exports = app => {
                 renderData.auditList = auditList;
 
                 // 获取是否已存在调用变更令
-                const changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, change.cid);
+                let changeUsedData = await ctx.service.stageChange.getFinalUsedData(ctx.tender.id, change.cid);
+                changeUsedData = ctx.helper._.filter(changeUsedData, function(item) {
+                    return item.used_qty !== null;
+                })
                 renderData.changeUsedData = changeUsedData;
                 renderData.stageChangeNum = this.ctx.helper.sum(changeUsedData.map(x => { return Math.abs(x.used_qty); }));
                 await this.layout('change/information.ejs', renderData, 'change/information_modal.ejs');

+ 3 - 4
app/public/report/js/rpt_archive.js

@@ -128,7 +128,6 @@ let rptArchiveObj = {
             try {
                 if (can_netcasign) {
                     const msgSign = _.find(ARCHIVE_ENCRYPTION_LIST, {rpt_id: me.currentNode.ID});
-                    console.log(msgSign, me.currentArchiveUuid);
                     me.currentEncryptionList = msgSign;
                     const uSignLogList = _.filter(signLogList, { uuid: me.currentArchiveUuid });
                     let html = '';
@@ -163,7 +162,7 @@ let rptArchiveObj = {
                         $('#show-removesign-modal-btn').hide();
                     }
                     postData('/tender/'+ TENDER_ID +'/signReport/post', {type: 'pdfIsExist', uuid: me.currentArchiveUuid}, function (result) {
-                        me.currentArchivePdfPath = result ? oss_path + '/sign/'+ me.currentArchiveUuid +'.PDF' + (uSignLogList.length !== 0 ? '?' + uSignLogList.length : '') : oss_path + '/'+ me.currentArchiveUuid +'.PDF';
+                        me.currentArchivePdfPath = result ? oss_path + '/sign/'+ me.currentArchiveUuid +'.PDF' + (uSignLogList.length !== 0 ? '?' + uSignLogList[uSignLogList.length-1].versionid : '') : oss_path + '/'+ me.currentArchiveUuid +'.PDF';
                         $('#iframe_made').html('<iframe src="/archive/pdf/show?file=' + me.currentArchivePdfPath + '" height="750px" width="100%" style="border: none;"></iframe>');
                     }, function () {
                         me.currentArchivePdfPath = oss_path + '/'+ me.currentArchiveUuid +'.PDF';
@@ -191,7 +190,7 @@ let rptArchiveObj = {
         if(can_netcasign) {
             postData('/tender/'+ TENDER_ID +'/signReport/post', {type: 'pdfIsExist', uuid: me.currentArchiveUuid}, function (result) {
                 const uSignLogList = _.filter(signLogList, { uuid: me.currentArchiveUuid });
-                me.currentArchivePdfPath = result ? oss_path + '/sign/'+ me.currentArchiveUuid +'.PDF' + (uSignLogList.length !== 0 ? '?' + uSignLogList.length : '') : oss_path + '/'+ me.currentArchiveUuid +'.PDF';
+                me.currentArchivePdfPath = result ? oss_path + '/sign/'+ me.currentArchiveUuid +'.PDF' + (uSignLogList.length !== 0 ? '?' + uSignLogList[uSignLogList.length-1].versionid : '') : oss_path + '/'+ me.currentArchiveUuid +'.PDF';
                 $('#iframe_made').html('<iframe src="/archive/pdf/show?file=' + me.currentArchivePdfPath + '" height="750px" width="100%" style="border: none;"></iframe>');
                 me._buildeArchiveDateSelect();
             }, function () {
@@ -250,7 +249,7 @@ let rptArchiveObj = {
         $('#page-list').html(pagetr);
         if (needFrame) {
             me.currentArchivePdfPath = uSignLogList.length > 0 ? oss_path + '/sign/'+ me.currentArchiveUuid +'.PDF' : oss_path + '/'+ me.currentArchiveUuid +'.PDF';
-            $('#iframe_made').html('<iframe src="/archive/pdf/show?file=' + me.currentArchivePdfPath + (uSignLogList.length !== 0 ? '?' + uSignLogList.length : '') + '" height="750px" width="100%" style="border: none;"></iframe>');
+            $('#iframe_made').html('<iframe src="/archive/pdf/show?file=' + me.currentArchivePdfPath + (uSignLogList.length !== 0 ? '?' + uSignLogList[uSignLogList.length-1].versionid : '') + '" height="750px" width="100%" style="border: none;"></iframe>');
         }
         $('#sign_num').text(uSignLogList.length);
         const uHadSign = _.filter(uSignLogList, { uid: USER_ID});

+ 20 - 2
app/view/report/index_sign.ejs

@@ -349,13 +349,31 @@
 
         $('#sign_pdf').click(function () {
             $(this).attr('disabled', true);
-            $(this).text('签名条件判断中...')
+            $(this).text('签名条件判断中...');
+            // 判断同表中历史归档是否已存在签名
+            const archiveList = _.find(ARCHIVE_LIST, { rpt_id: rptArchiveObj.currentNode.ID.toString() });
+            if (archiveList && archiveList.items) {
+                const aidList = _.map(archiveList.items, 'uuid');
+                _.remove(aidList, function (n) {
+                    return n === rptArchiveObj.currentArchiveUuid;
+                });
+                if (aidList.length > 0) {
+                    for (const a of aidList) {
+                        if (_.findIndex(signLogList, { uuid: a }) !== -1) {
+                            toastr.error('历史归档中已存在签名,请勿重复签署');
+                            $(this).attr('disabled', false);
+                            $(this).text('确定');
+                            return false;
+                        }
+                    }
+                }
+            }
             // 判断是否已选中签名位置
             const val = $("input[name='sign_role']:checked").val();
             if (!val) {
                 toastr.error('请选择签名位置');
                 $(this).attr('disabled', false);
-                $(this).text('确定')
+                $(this).text('确定');
                 return false;
             }
             console.log(val);