Browse Source

附件,删除问题

MaiXinRong 4 months ago
parent
commit
d25e873db0

+ 2 - 2
app/controller/pay_controller.js

@@ -320,8 +320,8 @@ module.exports = app => {
         async deleteFile(ctx) {
             try{
                 const data = JSON.parse(ctx.request.body.data);
-                if (!data) throw '缺少参数';
-                const result = await ctx.service.phasePayFile.delFiles(data);
+                if (!data && !data.id) throw '缺少参数';
+                const result = await ctx.service.phasePayFile.delFiles(data.id);
                 ctx.body = { err: 0, msg: '', data: result };
             } catch(error) {
                 ctx.log(error);

+ 1 - 0
app/public/js/phase_pay_detail.js

@@ -726,6 +726,7 @@ $(document).ready(() => {
                 if (info.newSelections) {
                     if (!info.oldSelections || info.newSelections[0].row !== info.oldSelections[0].row) {
                         payEvent.refreshActn();
+                        payFile.getCurAttHtml(SpreadJsObj.getSelectObject(info.sheet))
                     }
                 }
                 payEvent.loadExprToInput();

+ 0 - 2
app/service/phase_pay_file.js

@@ -71,8 +71,6 @@ module.exports = app => {
         }
 
         async delFiles(files) {
-            if (files.length === 0) return;
-
             const fileDatas = await this.getAllDataByCondition({ where: { id: files } });
             const result = {};