Procházet zdrojové kódy

调差可重复选计量期功能

ellisran před 11 měsíci
rodič
revize
04f6638d26

+ 1 - 0
app/const/page_show.js

@@ -58,6 +58,7 @@ const defaultSetting = {
     openBudget: 1,
     openPayment: 1,
     openConstruction: 1,
+    openMaterialStageRepeat: 0,
 };
 
 

+ 8 - 6
app/controller/material_controller.js

@@ -79,12 +79,14 @@ module.exports = app => {
                     // s.curAuditor = null;
                     // 根据期状态返回展示用户
                     s.curAuditor = await ctx.service.materialAudit.getAuditorByStatus(s.id, s.status, s.times);
-                    const materialStageList = s.stage_id.split(',');
-                    for (const ms of materialStageList) {
-                        const index = stages.findIndex(function(item) {
-                            return item.id === parseInt(ms);
-                        });
-                        stages.splice(index, 1);
+                    if (!ctx.session.sessionProject.page_show.openMaterialStageRepeat) {
+                        const materialStageList = s.stage_id.split(',');
+                        for (const ms of materialStageList) {
+                            const index = stages.findIndex(function(item) {
+                                return item.id === parseInt(ms);
+                            });
+                            stages.splice(index, 1);
+                        }
                     }
                     if (allMaterialTax && s.material_tax === 0) {
                         allMaterialTax = false;

+ 1 - 2
app/view/material/modal.ejs

@@ -23,7 +23,7 @@
                         <div class="col-4">
                             <div class="custom-control custom-checkbox">
                                 <input type="checkbox" class="custom-control-input select-stage-order" id="stage_<%= stage.id %>" name="stage_id[]" value="<%= stage.id %>" data-order="<%= stage.order %>">
-                                <label class="custom-control-label" for="stage_<%= stage.id %>">第<%= stage.order %>期</label>
+                                <label class="custom-control-label" for="stage_<%= stage.id %>">第<%= stage.order %>期(<%- stage.s_time  %>)</label>
                             </div>
                         </div>
                         <% } %>
@@ -47,7 +47,6 @@
                     <div>
                         <% for (const qs of qtySourceConst) { %>
                         <div class="form-check form-check-inline">
-                            <% console.log(materials.length) %>
                             <input type="radio" name="qty_source" id="<%- qs.key %>_source" class="form-check-input" value="<%- qs.value %>" <% if (materials && materials.length === 0 && qs.value === 1) { %>checked<% } else if (materials && materials.length > 0 && materials[0].qty_source === qtySourceValueConst[qs.key]) { %>checked<% } %>>
                             <label class="form-check-label" for="<%- qs.key %>_source"><%- qs.name %></label>
                         </div>