Kaynağa Gözat

feat: 调差-附件增加调差期列

lanjianrong 5 yıl önce
ebeveyn
işleme
e5c905f7d9

+ 1 - 2
app/controller/material_controller.js

@@ -616,8 +616,6 @@ module.exports = app => {
                     const filepath = path.join('public/upload', this.ctx.tender.id.toString(), 'tc', 'fujian_' + create_time + fileInfo.ext);
                     await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, 'app', filepath));
                     files.push({ filepath, name: stream.filename });
-                    // 将上传的文件流消费掉,防止浏览器卡死
-                    stream && (await sendToWormhole(stream));
                 }
                 const upload_time = this.ctx.helper.dateTran(new Date());
                 const payload = files.map(file => {
@@ -631,6 +629,7 @@ module.exports = app => {
                         tid: ctx.tender.id,
                         user_id: ctx.session.sessionUser.accountId,
                         mid: ctx.material.id,
+                        s_order: ctx.params.order,
                         upload_time,
                         filepath: file.filepath,
                         file_size: ctx.helper.bytesToSize(idx === 'isString' ? parts.field.size : parts.field.size[idx]),

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

@@ -115,7 +115,7 @@ $(document).ready(function () {
  * @param {Array} files 文件数组
  */
 function validateFiles(files) {
-    const reg = /(doc|docx|excel|xlsx|xls|txt|zip|jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
+    const reg = /(doc|docx|excel|pdf|xlsx|xls|txt|zip|jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
     return files.every(file => {
         if (file.size > 1024 * 1024 * 10) {
             toastr.error('文件大小限制为10MB');

+ 4 - 4
app/view/material/file.ejs

@@ -18,15 +18,15 @@
       <div class="sjs-height-0">
         <table class="table table-bordered">
           <thead>
-            <tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="100">上传时间</th><th width="100">操作</th></tr>
+            <tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="90">调差期</th><th width="150">上传时间</th><th width="100">操作</th></tr>
           </thead>
           <tbody id="file-list">
             <% fileList.forEach(function(file, idx){ %>
               <tr>
                 <td><%=idx + 1%></td>
-                <td>
-                  <a href="/<%- file.filepath %>" target="_blank"><%=file.file_name%></a>
-                </td><td><%=file.file_size%></td>
+                <td><a href="/<%- file.filepath %>" target="_blank"><%=file.file_name%></a></td>
+                <td><%=file.file_size%></td>
+                <td>第<%= file.s_order %>期</td>
                 <td><%=file.upload_time%></td>
                 <td>
                   <% if(material.status !== auditConst.status.checked &&

+ 3 - 0
sql/update.sql

@@ -99,3 +99,6 @@ ALTER TABLE `zh_project_account` ADD `wx_type` TEXT NULL DEFAULT NULL COMMENT '
 
 ALTER TABLE `zh_rpt_custom_define`
 ADD COLUMN `stage_select`  text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '用户定制信息 - 多期汇总表' AFTER `gather_select`;
+
+ALTER TABLE `calculation`.`zh_material_file`
+ADD COLUMN `s_order` VARCHAR(255) NOT NULL  COMMENT '期数order' AFTER `file_name`;