Bläddra i källkod

灰选安全生产费

laiguoran 2 år sedan
förälder
incheckning
98d94daa4e

+ 1 - 1
app/const/payment.js

@@ -34,7 +34,7 @@ const const_rpt_list = [
 
 const setting_modes = {
     safe: {
-        name: '安全生产费',
+        name: '安全生产费(当前版本未做功能,请忽略)',
         checked: false,
         value: 1,
     },

+ 1 - 1
app/controller/payment_controller.js

@@ -252,7 +252,7 @@ module.exports = app => {
                 const modes = projectInfo.payment_setting ? JSON.parse(projectInfo.payment_setting) : ctx.helper._.cloneDeep(paymentConst.setting_modes);
                 for (const m in modes) {
                     const detailCount = await ctx.service.paymentDetail.getCountByPidType(ctx.session.sessionProject.id, modes[m].value);
-                    modes[m].can_check = !detailCount;
+                    modes[m].can_check = !detailCount && modes[m].value !== 1;
                 }
                 const renderData = {
                     setting_modes: paymentConst.setting_modes,

+ 3 - 0
app/middleware/payment_tender_check.js

@@ -33,6 +33,9 @@ module.exports = options => {
                 if (!modes[m]) modes[m] = _.cloneDeep(paymentConst.setting_modes[m]);
             }
             const auditPermission = yield this.service.paymentPermissionAudit.getOnePermission(this.session.sessionUser.is_admin, this.session.sessionUser.accountId);
+            if (!auditPermission) {
+                throw '权限不足';
+            }
             if (!tender) {
                 throw '标段不存在';
             }

+ 2 - 2
app/public/js/payment_process.js

@@ -475,8 +475,8 @@ $(function () {
     };
 
     $('#add-rpt').on('show.bs.modal', function () {
-        $('#rpt-table').find('input:checked:not(:disabled)').prop('checked', false);
-        $('#rpt-table').find('input:not(:disabled)').each(function () {
+        $('#rpt_table').find('input:checked:not(:disabled)').prop('checked', false);
+        $('#rpt_table').find('input:not(:disabled)').each(function () {
             if (_.findIndex(tenderRptList, { rpt_id: parseInt($(this).val()) }) !== -1) {
                 $(this).prop('checked', true);
             }

+ 1 - 1
app/view/payment/process_modal.ejs

@@ -5,7 +5,7 @@
                 <h5 class="modal-title">添加表单</h5>
             </div>
             <div class="modal-body" style="max-height:800px;overflow: auto">
-                <table id="rpt-table" class="table table-bordered">
+                <table id="rpt-table1" class="table table-bordered">
                     <thead>
                     <tr>
                         <th class="text-center"><input type="checkbox" id="select_all_rpt_checkbox"> 选择</th>