From 02cdd5f7521065c444e43e71c395c8c74054b183 Mon Sep 17 00:00:00 2001
From: zm <zm@iemsoft.cn>
Date: Wed, 26 Aug 2020 21:52:01 +0800
Subject: [PATCH] 附件管理功能开发,采购入库单导出pdf增加备注字段,采购入库和销售出库的提交按钮名称修改为审核按钮

---
 src/web/Public/Scripts/PSI/Attachment/AttachmentList.js |   56 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/src/web/Public/Scripts/PSI/Attachment/AttachmentList.js b/src/web/Public/Scripts/PSI/Attachment/AttachmentList.js
index 357f42b..474dcd2 100644
--- a/src/web/Public/Scripts/PSI/Attachment/AttachmentList.js
+++ b/src/web/Public/Scripts/PSI/Attachment/AttachmentList.js
@@ -36,10 +36,6 @@
         title: me.formatGridHeaderTitle("附件")
       },
       padding: 5,
-      selModel: {
-        mode: "MULTI"
-      },
-      selType: "checkboxmodel",
       viewConfig: {
         deferEmptyText: false,
         emptyText: ""
@@ -49,7 +45,7 @@
       columns: [{
         header: "附件名",
         dataIndex: "fileName",
-        width: 300,
+        width: 400,
         menuDisabled: true,
         renderer: function (value, md, record) {
           return "<a href='"
@@ -67,18 +63,23 @@
         dataIndex: "createOn",
         width: 170,
         menuDisabled: true
-      },{
+      }, {        
         header: "操作",
-        dataIndex: "fullName",
-        width: 110,
+        align: "center",
         menuDisabled: true,
-        sortable: false,
-        renderer: function (value, md, record) {
-          return "<a href='"
-            + PSI.Const.BASE_URL
-            + record.get("fullName")
-            + "' target='_blank'>下载</a>";
-        }
+        width: 50,
+        xtype: "actioncolumn",
+        items: [{
+          icon: PSI.Const.BASE_URL
+            + "Public/Images/icons/delete.png",
+          handler: function (grid, row) {
+            PSI.MsgBox.confirm("请确认是否要删除此附件", function () {
+              var store = grid.getStore();
+              me.onDelete(store.getAt(row).get("id"));
+            });
+          },
+          scope: this
+        }]
       }]
     });
 
@@ -248,5 +249,30 @@
         PSI.MsgBox.showInfo(action.result.msg);
       }
     });
+  },
+  
+  onDelete: function (id) {
+    var me = this;
+    Ext.Ajax.request({
+      url: PSI.Const.BASE_URL
+        + "Home/Attachment/delete",
+      params: { 
+        attachmentId:id       
+      },
+      method: "POST",
+      callback: function (options, success, response) {
+        if (success) {
+          var data = Ext.JSON.decode(response.responseText);
+          if(data.success){
+            PSI.MsgBox.showInfo("删除成功");
+            me.onWndShow();
+          }else{
+            PSI.MsgBox.showInfo("删除失败");
+          }
+        }else{
+          PSI.MsgBox.showInfo("删除失败");
+        }
+      }
+    });
   }
 });

--
Gitblit v1.8.0