ソースを参照

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong 4 年 前
コミット
7421134ac2

+ 4 - 4
app/const/advance.js

@@ -12,15 +12,15 @@
 const typeCol = [
     { key: 'start', type: 0, name: '开工预付款' },
     { key: 'material', type: 1, name: '材料预付款' },
-    { key: 'safe', type: 2, name: '安全生产预付款' },
-    { key: 'dust', type: 3, name: '扬尘污染预付款' },
+    { key: 'safe', type: 2, name: '安全生产预付款' },
+    { key: 'dust', type: 3, name: '扬尘污染预付款' },
 ];
 
 const typeColMap = {
     0: { text: '开工预付款', value: 'start' },
     1: { text: '材料预付款', value: 'material' },
-    2: { text: '安全生产预付款', value: 'safe' },
-    3: { text: '扬尘污染预付款', value: 'dust' },
+    2: { text: '安全生产预付款', value: 'safe' },
+    3: { text: '扬尘污染预付款', value: 'dust' },
 };
 
 

+ 1 - 1
app/controller/advance_controller.js

@@ -145,7 +145,7 @@ module.exports = app => {
          * @param {Object} ctx 全局上下文
          */
         async detail(ctx) {
-            const advancePayTotal = ctx.tender.info.deal_param[`${typeConsts.typeColMap[ctx.advance.type].value}startAdvance`];
+            const advancePayTotal = ctx.tender.info.deal_param[`${typeConsts.typeColMap[ctx.advance.type].value}Advance`];
             try {
                 await this._checkCanEntry(ctx);
                 const { uncheck, checkNo } = auditConst.status;

+ 10 - 3
app/public/js/advance.js

@@ -10,9 +10,9 @@
 
 $(document).ready(function () {
 
-    if (!advancePayTotal) {
-        $('#erro').modal('show');
-    }
+    // if (!advancePayTotal) {
+    //     $('#erro').modal('show');
+    // }
 
     // $('#advance_add').click(function() {
     //     postData(`${window.location.pathname}/${type}/create`, {}, res => {
@@ -33,6 +33,13 @@ $(document).ready(function () {
     //     return false
     // })
 
+    $('.ml-auto').submit(function () {
+        if (!advancePayTotal) {
+            $('#erro').modal('show');
+            return false;
+        }
+        return true;
+    })
     $('#advanceList').on('click', `a[href="#file"]`, function() {
         const { fileList = [] } = advanceList.find(item => item.id === parseInt($(this).data('id')))
         $('#file-content').empty()

+ 3 - 3
app/router.js

@@ -137,8 +137,8 @@ module.exports = app => {
     // 预付款
     app.get('/tender/:id/advance/:type', sessionAuth, tenderCheck, 'advanceController.index');
     // app.get('/tender/:id/advance/material', sessionAuth, tenderCheck, 'advanceController.materialList');
-    app.post('/tender/:id/advance/create', sessionAuth, tenderCheck, 'advanceController.create');
-    app.post('/tender/:id/advance/delete', sessionAuth, tenderCheck, 'advanceController.delete');
+    app.post('/tender/:id/advance/:type/create', sessionAuth, tenderCheck, 'advanceController.create');
+    app.post('/tender/:id/advance/:type/delete', sessionAuth, tenderCheck, 'advanceController.delete');
     app.get('/tender/:id/advance/:order/detail', sessionAuth, tenderCheck, advanceCheck, 'advanceController.detail');
     app.post('/tender/:id/advance/:type/create', sessionAuth, tenderCheck, 'advanceController.create');
     app.post('/tender/:id/advance/:order/audit/add', sessionAuth, tenderCheck, advanceCheck, 'advanceController.addAudit');
@@ -149,7 +149,7 @@ module.exports = app => {
     app.post('/tender/:id/advance/:order/file/upload', sessionAuth, tenderCheck, advanceCheck, 'advanceController.upload');
     app.get('/tender/:id/advance/:order/file/:fid/download', sessionAuth, tenderCheck, 'advanceController.downloadFile');
     app.post('/tender/:id/advance/:order/file/del', sessionAuth, tenderCheck, advanceCheck, 'advanceController.deleteFile');
-    app.post('/tender/:id/advance/:order/auditors', sessionAuth, tenderCheck, advanceCheck, 'advanceController.getAuditors');
+    app.post('/tender/:id/advance/:type/:order/auditors', sessionAuth, tenderCheck, advanceCheck, 'advanceController.getAuditors');
 
     // 标段协作办公
     app.get('/tender/:id/cooperation', sessionAuth, tenderCheck, 'tenderController.tenderCooperation');

+ 1 - 1
app/view/advance/detail.ejs

@@ -22,7 +22,7 @@
                         <thead>
                             <tr>
                                 <th colspan="4" class="text-center">
-                                    签约<%- typeColMap[advance.type].text %>:<%- ctx.helper.formatMoney(advancePayTotal, ',', parseFloat(advancePayTotal).toString().split('.')[1] && parseFloat(advancePayTotal).toString().split('.')[1].length || 0) %>
+                                    <%- typeColMap[advance.type].text %>:<%- ctx.helper.formatMoney(advancePayTotal, ',', parseFloat(advancePayTotal).toString().split('.')[1] && parseFloat(advancePayTotal).toString().split('.')[1].length || 0) %>
                                 </th>
                             </tr>

+ 3 - 3
app/view/advance/index.ejs

@@ -12,15 +12,15 @@
                             材料预付款<%- type === 1 && latestOrder ? `(第${latestOrder.order}期)` : '' %>
                         </a>
                         <a class="btn btn-sm btn-light <%- type === 2 ? 'active' : '' %>" href="/tender/<%- ctx.tender.id %>/advance/safe">
-                          安全生产预付款<%- type === 2 && latestOrder ? `(第${latestOrder.order}期)` : '' %>
+                          安全生产预付款<%- type === 2 && latestOrder ? `(第${latestOrder.order}期)` : '' %>
                         </a>
                         <a class="btn btn-sm btn-light <%- type === 3 ? 'active' : '' %>" href="/tender/<%- ctx.tender.id %>/advance/dust">
-                          扬尘污染预付款<%- type === 3 && latestOrder ? `(第${latestOrder.order}期)` : '' %>
+                          扬尘污染预付款<%- type === 3 && latestOrder ? `(第${latestOrder.order}期)` : '' %>
                         </a>
                     </div>
                 </div>
                 <div class="d-inline-block ml-2">
-                    签约<%- typeColMap[type].text%>
+                    <%- typeColMap[type].text%>
                     <b><%- ctx.helper.formatMoney(advancePayTotal, ',', parseFloat(advancePayTotal).toString().split('.')[1] && parseFloat(advancePayTotal).toString().split('.')[1].length || 0) %></b> 元
                 </div>
                 <div class="d-inline-block ml-4" style="width:300px">

+ 2 - 2
app/view/advance/modal.ejs

@@ -6,8 +6,8 @@
                 <h5 class="modal-title">提示</h5>
             </div>
             <div class="modal-body">
-                <p>预付款金额未填写,无法使用「预付款」,请先填写预付款金额;</p>
-                <p>进入「标段概况」打开「合同参数」填写预付款金额。</p>
+                <p><%- typeColMap[type].text %>金额未填写,无法使用「<%- typeColMap[type].text %> 」,请先填写<%- typeColMap[type].text %>金额;</p>
+                <p>进入「标段概况」打开「合同参数」填写<%- typeColMap[type].text %>金额。</p>
             </div>
             <div class="modal-footer">
               <a href="/tender/<%- ctx.tender.id %>" class="btn btn-sm btn-primary">标段概况</a>