ellisran пре 2 дана
родитељ
комит
cfe5e3b5e1
3 измењених фајлова са 8 додато и 3 уклоњено
  1. 1 1
      app/public/js/file_detail.js
  2. 6 2
      app/public/report/js/rpt_change_rela.js
  3. 1 0
      app/view/report/index.ejs

+ 1 - 1
app/public/js/file_detail.js

@@ -1220,7 +1220,7 @@ $(document).ready(function() {
                 const checked = f.checked ? "checked" : '';
                 html.push(`<td><input type="checkbox" name="rf-check" rfid="${f.rf_id}" ${checked}></td>`);
                 html.push(`<td>${f.filename}${f.fileext}</td>`);
-                html.push(`<td>${typeStr.join(' - ')}</td>`);
+                html.push(`<td>${_.escape(typeStr.join(' - '))}</td>`);
                 html.push('</tr>');
             }
             $('#rf-files').html(html.join(''));

+ 6 - 2
app/public/report/js/rpt_change_rela.js

@@ -9,7 +9,7 @@ const rptChangeRela = (function (){
     let curType = '';
     const initList = function () {
         const header = info[curType].colHeader;
-        $('#scr-header').html(`<tr class="text-center"><th>${header[0]}</th><th style="vertical-align: middle">${header[1]}</th><th style="vertical-align: middle">${header[2]}</th></tr>`);
+        $('#scr-header').html(`<tr class="text-center"><th>${header[0]}</th><th style="vertical-align: middle">${_.escape(header[1])}</th><th style="vertical-align: middle">${header[2]}</th></tr>`);
         const html = [], arr = data[curType];
         for (const a of arr) {
             const checked = a.selected ? 'checked' : '';
@@ -19,6 +19,10 @@ const rptChangeRela = (function (){
     };
     const showChangeRela = async function (type) {
         curType = type;
+        if (type === 'change_plan') {
+            info.change_plan.title = '请选择' + reportChangePlanName;
+            info.change_plan.colHeader[1] = reportChangePlanName + '编号';
+        }
         document.getElementById('scr-title').innerText = info[type].title;
         if (!data[type]) {
             const result = await postDataAsync(`/tender/${window.location.pathname.split('/')[2]}/load`, { filter: curType });
@@ -72,4 +76,4 @@ const rptChangeRela = (function (){
         $('#select-change-rela').modal('hide');
     };
     return { showChangeRela, updateChangeRela }
-})();
+})();

+ 1 - 0
app/view/report/index.ejs

@@ -419,6 +419,7 @@
 <script src="/public/js/sub_menu.js"></script>
 <script src="/public/js/div_resizer.js"></script>
 <script>
+    const reportChangePlanName = decodeURIComponent('<%- encodeURIComponent(ctx.subProject && ctx.subProject.fun_set && ctx.subProject.fun_set.change_plan_name || '变更方案').replace(/'/g, '%27') %>');
     const IS_ADMIN = <%- isAdmin %>;
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',