Przeglądaj źródła

删除全部,导出

chenrui 2 lat temu
rodzic
commit
80938dfd20

+ 25 - 2
src/views/salesManagement/salesQuery/edit.vue

@@ -223,7 +223,7 @@ import queryPart from './queryPart.vue'
 import queryPromotable from './queryPromotable.vue'
 import ChooseActive from './chooseActive.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { salesDetailBySn, salesWriteSubmit, getPromoacActiveList } from '@/api/sales'
+import { salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll } from '@/api/sales'
 import { salesDetailStockList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, salesDetailDelAll, addPromoGoods, salesBatchInsert } from '@/api/salesDetail'
 export default {
   name: 'SalesEdit',
@@ -299,12 +299,35 @@ export default {
   },
   methods: {
     handleMenuClick (e) {
-
+      if (e.key == 1) { // 删除已选项
+        this.handleBatchDel()
+      } else {
+        this.handleBatchDelAll()
+      }
     },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    handleBatchDelAll () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除全部已选产品吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          deleteAll({ salesBillSn: _this.productForm.salesBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(true)
+              _this.$refs.promotable.resetCurForm()
+              _this.$message.success(res.message)
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 批量删除已选产品
     handleBatchDel () {
       const _this = this

+ 10 - 12
src/views/salesManagement/salesQuery/stockOutDetailModal.vue

@@ -49,7 +49,7 @@
 
 <script>
 import { STable } from '@/components'
-import { salesStockoutDetail } from '@/api/salesDetail'
+import { salesStockoutDetail, exportStockout, exportGroupStockout } from '@/api/salesDetail'
 import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   name: 'StockOutDetail',
@@ -117,20 +117,21 @@ export default {
       _this.exportLoading = true
       _this.disabled = true
       _this.spinning = true
-      hdExportExcel('api', '', '销售单缺货产品导出', function () {
+      hdExportExcel(exportStockout, { salesBillSn: _this.salesBillSn }, '销售单缺货产品导出', function () {
         _this.exportLoading = false
         _this.spinning = false
         _this.disabled = false
       })
     },
     handleClassifyExport () {
-      this.exportClassifyLoading = true
-      this.disabled = true
-      this.spinning = true
-      hdExportExcel('api', '', '销售单缺货产品分类导出', function () {
-        this.exportClassifyLoading = false
-        this.spinning = false
-        this.disabled = false
+      const _this = this
+      _this.exportClassifyLoading = true
+      _this.disabled = true
+      _this.spinning = true
+      hdExportExcel(exportGroupStockout, { isOos: 1, salesBillSn: _this.salesBillSn }, '销售单缺货产品分类导出', function () {
+        _this.exportClassifyLoading = false
+        _this.spinning = false
+        _this.disabled = false
       })
     }
   },
@@ -147,9 +148,6 @@ export default {
           this.$refs.table.refresh()
         })
       }
-    },
-    itemSn (nVal, oVal) {
-
     }
   }
 }