Browse Source

fix: 预付款附件保持文件名与路径存储中的文件名一致

lanjianrong 5 năm trước cách đây
mục cha
commit
84cb5e80aa
2 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 1 1
      app/controller/advance_controller.js
  2. 3 2
      app/public/js/advance_audit.js

+ 1 - 1
app/controller/advance_controller.js

@@ -336,7 +336,7 @@ module.exports = app => {
                     const fileInfo = path.parse(stream.filename);
                     const filepath = `public/upload/${this.ctx.tender.id.toString()}/yfk/fujian_${create_time + idx.toString() + fileInfo.ext}`;
                     await ctx.helper.saveStreamFile(stream, path.resolve(this.app.baseDir, 'app', filepath));
-                    files.push({ filepath, name: stream.filename });
+                    files.push({ filepath, name: `fujian_${create_time + idx.toString() + fileInfo.ext}` });
                     ++idx;
                     stream && (await sendToWormhole(stream));
                 }

+ 3 - 2
app/public/js/advance_audit.js

@@ -185,11 +185,12 @@ $(document).ready(function () {
 
     $('#ad-remark').on('input propertychange', function(e) {
         const remark = filterText(e.target.value);
-        const data = { remark }
         oldVal = {
+            pay_ratio: parseInt($(`.pay-input[data-type=${0}]`).val()),
             cur_amount: parseInt($(`.pay-input[data-type=${1}]`).val()),
             remark
         }
+        const data = oldVal
         clearTimeout(timer)
         timer = setTimeout(() => {
             if (checkInput()) {
@@ -236,7 +237,7 @@ $(document).ready(function () {
     })
     function handleFileList(files) {
         $('#file-content').empty()
-        const { uncheck, checkNo } = auditConst
+        const { uncheck, checkNo } = auditConst.status
         const newFiles = files.map(file => {
             let showDel = false;
             if (file.uid === cur_uid) {