Jelajahi Sumber

附件相关

MaiXinRong 2 hari lalu
induk
melakukan
cdcbb2d116

+ 2 - 8
app/public/js/stage.js

@@ -5196,14 +5196,8 @@ $(document).ready(() => {
             }, `确认删除附件「${att.filename}」?`);
 
         } else if (content === 'view') {
-            const data = {id: fid};
-            postData('/tender/' + tender.id + '/measure/stage/' + stage.order + '/check/file', data, function (result) {
-                const { filepath } = result
-                $('#load-file').attr('href', filepath);
-                $('#load-file')[0].click();
-                // $('#show-att tr').eq(2).find('a').attr('href', filepath)
-              // $('#show-att tr').eq(2).find('a').children('span').eq(0).trigger('click')
-            });
+            const att = attData.find(item => item.id === parseInt(fid));
+            window.open(att.viewpath || att.orginpath);
         } else if (content === 'location') {
             const att = attData.find(item => item.id === parseInt(fid));
             if (Object.keys(att).length) {

+ 1 - 1
app/service/phase_pay_file.js

@@ -26,8 +26,8 @@ module.exports = app => {
             const userId = this.ctx.session.sessionUser.accountId;
             const ossPath = this.ctx.app.config.fujianOssPath;
             files.forEach(x => {
-                x.viewpath = helper.canPreview(x.fileext) ? ossPath + x.filepath : '';
                 x.filepath = ossPath + x.filepath;
+                x.viewpath = this.ctx.helper.getPreviewPath(x.fileext, x.filepath);
                 x.fileext_str = helper.fileExtStr(x.fileext);
                 x.canEdit = x.user_id === userId;
             });

+ 2 - 0
app/service/stage_att.js

@@ -74,6 +74,8 @@ module.exports = app => {
             const result = await this.db.query(sql, sqlParam);
             return result.map(item => {
                 item.orginpath = this.ctx.app.config.fujianOssPath + item.filepath;
+                item.filepath = this.ctx.app.config.fujianOssPath + item.filepath;
+                item.viewpath = this.ctx.helper.getPreviewPath(item.fileext, item.filepath);
                 delete item.filepath;
                 // if (!this.ctx.helper.canPreview(item.fileext)) {
                 //     item.filepath = `/tender/${this.ctx.tender.id}/measure/stage/${this.ctx.params.order}/download/file/${item.id}`;

+ 5 - 1
app/service/stage_bonus.js

@@ -9,6 +9,8 @@
  */
 
 const auditConst = require('../const/audit').stage;
+const path = require('path');
+
 module.exports = app => {
     class StageBonus extends app.BaseService {
         /**
@@ -30,7 +32,9 @@ module.exports = app => {
                 if (d.proof_file) {
                     d.proof_file = JSON.parse(d.proof_file);
                     d.proof_file.forEach(f => {
-                        f.viewpath = helper.getPreviewPath(f.fileext, f.filepath.substr(3, f.filepath.length - 3));
+                        if (helper.canPreview(f.fileext)){
+                            f.viewpath = f.filepath.substr(3, f.filepath.length - 3);
+                        }
                     });
                 } else {
                     d.proof_file = [];

+ 9 - 0
sql/update.sql

@@ -1,4 +1,8 @@
+-- sql提交须知:
+-- 1. 请按如下分类提交sql!!!
+-- 2. 表名前不可有库名!!!
+-- 3. 表结构部分,新添加的表,不可先创建后修改!!!
+--
 -- Version V3.5.51.0145
 -- uat 2026-01-21
 -- prod 2026-01-22
@@ -474,6 +478,10 @@ CREATE TABLE `zh_contract_sp_audit` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT = '合同详情和合同支付,回款审批人表';
 
+ALTER TABLE `zh_ancillary_gcl`
+ADD COLUMN `pid` varchar(36) NOT NULL DEFAULT '' COMMENT '计量单元id' AFTER `lid`,
+ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '明细计算模板' AFTER `update_time`;
+
 ------------------------------------
 -- 表数据
 ------------------------------------