浏览代码

计量台账附件内容
1.附件表格宽度过长bug更新
2.附件编号显示null bug

附件上传格式添加ppt,pptx

laiguoran 5 年之前
父节点
当前提交
f89522c76d
共有 3 个文件被更改,包括 15 次插入15 次删除
  1. 11 12
      app/public/js/stage.js
  2. 3 3
      app/view/stage/index.ejs
  3. 1 0
      config/config.default.js

+ 11 - 12
app/public/js/stage.js

@@ -1251,7 +1251,6 @@ $(document).ready(() => {
             $('#showPage').show();
         }
     });
-
     // 上传附件
     $('#upload-file-btn').click(function () {
         const file = $('#upload-file')[0];
@@ -1274,7 +1273,7 @@ $(document).ready(() => {
         formData.append('lid', node.id);
         formData.append('size', filesize);
         formData.append('file', file.files[0]);
-        postDataWithFile('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/upload/file', formData, function (data) {
+        postDataWithFile('/tender/' + tender.id + '/measure/stage/' + stage.order + '/upload/file', formData, function (data) {
             $('#upload').modal('hide');
             // 插入到attData中
             attData.unshift(data);
@@ -1300,9 +1299,9 @@ $(document).ready(() => {
         $('#show-att').show();
         if (att !== undefined) {
             $('#show-att tr').eq(0).children('td').text(att.filename + att.fileext);
-            const name = att.code !== null && att.code !== '' ? att.code : att.b_code;
-            $('#show-att tr').eq(1).children('td').text(name + ' ' + att.lname);
-            $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/download/file/' + att.id);
+            const name = att.code !== null && att.code !== '' ? att.code : (att.b_code !== null ? att.b_code : '');
+            $('#show-att tr').eq(1).children('td').text($.trim(name + ' ' + att.lname));
+            $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id);
             $('#show-att tr').eq(3).children('td').eq(0).text(att.username);
             $('#show-att tr').eq(3).children('td').eq(1).text(att.in_time);
             $('#show-att tr').eq(4).children('td').text(att.remark);
@@ -1344,8 +1343,8 @@ $(document).ready(() => {
             });
             $('#edit-att .form-group').eq(0).find('input').val(att.filename);
             $('#edit-att .form-group').eq(0).find('span').eq(1).text(att.fileext);
-            const name = att.code !== null && att.code !== '' ? att.code : att.b_code;
-            $('#edit-att .form-group').eq(1).find('input').val(name + ' ' + att.lname);
+            const name = att.code !== null && att.code !== '' ? att.code : (att.b_code !== null ? att.b_code : '');
+            $('#edit-att .form-group').eq(1).find('input').val($.trim(name + ' ' + att.lname));
             $('#edit-att .form-group').eq(2).find('input').val(att.in_time);
             $('#edit-att .form-group').eq(3).find('input').val(att.remark);
         } else if (content === 'cancel') {
@@ -1367,7 +1366,7 @@ $(document).ready(() => {
                 formData.append('size', filesize);
                 formData.append('file', file.files[0]);
             }
-            postDataWithFile('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/save/file', formData, function (data) {
+            postDataWithFile('/tender/' + tender.id + '/measure/stage/' + stage.order + '/save/file', formData, function (data) {
                 // 替换到attData中
                 const att_index = attData.findIndex(function (item) {
                     return item.id === parseInt(fid);
@@ -1379,9 +1378,9 @@ $(document).ready(() => {
                 $('#show-att').show();
                 $('#edit-att').hide();
                 $('#show-att tr').eq(0).children('td').text(data.filename + data.fileext);
-                const name = data.code !== null && data.code !== '' ? data.code : data.b_code;
-                $('#show-att tr').eq(1).children('td').text(name + ' ' + data.lname);
-                $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/download/file/' + data.id);
+                const name = data.code !== null && data.code !== '' ? data.code : (data.b_code !== null ? data.b_code : '');
+                $('#show-att tr').eq(1).children('td').text($.trim(name + ' ' + data.lname));
+                $('#show-att tr').eq(2).find('a').attr('href', '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + data.id);
                 $('#show-att tr').eq(3).children('td').eq(0).text(data.username);
                 $('#show-att tr').eq(3).children('td').eq(1).text(data.in_time);
                 $('#show-att tr').eq(4).children('td').text(data.remark);
@@ -1395,7 +1394,7 @@ $(document).ready(() => {
             $('#change-att-btn').val('');
         } else if (content === 'del') {
             const data = {id: fid};
-            postData('/tender/' + tender.id + '/measure/stage/' + tender.ledger_times + '/delete/file', data, function (result) {
+            postData('/tender/' + tender.id + '/measure/stage/' + stage.order + '/delete/file', data, function (result) {
                 // 删除到attData中
                 const att_index = attData.findIndex(function (item) {
                     return item.id === parseInt(fid);

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

@@ -114,7 +114,7 @@
                         <div class="tab-content">
                             <div class="tab-pane active" id="dqjiedian">
                                 <div class="sjs-height-3" style="overflow:auto; overflow-x:hidden;">
-                                    <table class="table table-sm table-bordered table-hover">
+                                    <table class="table table-sm table-bordered table-hover" style="word-break:break-all; table-layout: fixed">
                                         <tr><th>文件名</th><th width="80">上传</th></tr>
                                         <tbody id="nodelist-table" class="list-table">
                                         </tbody>
@@ -123,7 +123,7 @@
                             </div>
                             <div class="tab-pane" id="syfujian">
                                 <div class="sjs-height-3" style="overflow:auto; overflow-x:hidden;">
-                                    <table class="table table-sm table-bordered table-hover">
+                                    <table class="table table-sm table-bordered table-hover" style="word-break:break-all; table-layout: fixed">
                                         <tr><th>文件名</th><th width="80">上传</th></tr>
                                         <tbody id="alllist-table" class="list-table">
                                         </tbody>
@@ -144,7 +144,7 @@
                                             <a href="javascript:void(0);" content="cancel" class="btn btn-sm btn-outline-secondary" style="display: none">取消</a>
                                         </div>
                                         <!--显示信息-->
-                                        <table class="table table-sm table-bordered" id="show-att">
+                                        <table class="table table-sm table-bordered" id="show-att" style="word-break:break-all; table-layout: fixed">
                                             <tbody>
                                             <tr><th>文件名</th><td colspan="3">asdasd.jpg</td></tr>
                                             <tr><th>所在节点</th><td colspan="3">1 第一部分 建筑安装工程非</td></tr>

+ 1 - 0
config/config.default.js

@@ -106,6 +106,7 @@ module.exports = appInfo => {
             '.xls', '.xlsx',
             '.doc', '.docx',
             '.pdf',
+            '.ppt', '.pptx',
             '.png', '.jpg', '.jpeg', '.gif', '.bmp',
             '.zip', '.rar', '.7z'],
         fileSize: '30mb',