Browse Source

出运明细-批量删除

jbb 1 year ago
parent
commit
f6f4b5e121
2 changed files with 37 additions and 2 deletions
  1. 5 1
      src/api/document/shipmentList.js
  2. 32 1
      src/views/shipment-details/shipmentList.vue

+ 5 - 1
src/api/document/shipmentList.js

@@ -59,6 +59,9 @@ const listExportXls = params => getAction('/shippingDetails/syShippingDetails/ex
 // 编辑删除
 const deleteEdit = params => postAction('/shippingDetails/syShippingDetails/singleRowdelect', params)
 
+
+//  批量删除
+const deleteBatch = params => deleteAction('/shippingDetails/syShippingDetails/deleteBatch', params)
 //报关要素查询按钮
 const queryLatelyDeclarationElements = params => getAction('/shippingDetails/syShippingDetails/queryLatelyDeclarationElements',params)
 
@@ -81,5 +84,6 @@ export {
   exportXls,
   deleteEdit,
   queryLatelyDeclarationElements,
-  listExportXls
+  listExportXls,
+  deleteBatch
 }

+ 32 - 1
src/views/shipment-details/shipmentList.vue

@@ -180,6 +180,7 @@
         <a-button type="primary" icon="download" @click="exportXlsShipment('出运明细列表')">出运明细导出</a-button>
         <a-button type="primary" icon="check" @click="submit">批量提交</a-button>
         <a-button type="primary" icon="close" @click="cancelSubmit">批量取消提交</a-button>
+        <a-button type="primary" icon="close" @click="batchDelete">批量删除</a-button>
       </div>
 
       <!-- 子表  :row-key="record => record.id"  :pagination="ipagination-->
@@ -349,7 +350,8 @@ import {
   pushShipment,
   rePushShipment,
   exportXls,
-  listExportXls
+  listExportXls,
+  deleteBatch
 } from '@api/document/shipmentList'
 
 export default {
@@ -1032,6 +1034,35 @@ export default {
         })
       })
     },
+    
+    //批量删除
+    batchDelete(){
+      this.$nextTick(() => {
+        var grouyIdList = []
+        this.loading = true
+        this.shipmentListData.map(item =>{
+          this.selectedRowKeys.map(e=>{
+            if(item.itemIds == e){
+              grouyIdList.push(item.groupId)
+            }
+          })
+        })
+        deleteBatch({ submitListId: this.selectedRowKeys ,grouyIdList:grouyIdList}).then(res => {
+        this.loading = false
+          if (res.success) {
+            // console.log('提交成功,单据状态改为【已提交】')
+            // this.shipmentListData.submitStatus = '1'
+            this.selectedRowKeys =[]
+             this.judageAdd()
+             // 渲染 发运明细列表
+            this.$message.success('批量成功')
+          }else {
+            this.judageAdd()
+             this.$message.error(res.message)
+          }
+        })
+      })
+    },
 
     //  推送
     push(record) {