|
@@ -45,6 +45,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
id="viewTotalProduct-allbtn"
|
|
id="viewTotalProduct-allbtn"
|
|
style="margin-right:10px;"
|
|
style="margin-right:10px;"
|
|
|
|
+ @click="handleDel()"
|
|
> 批量删除</a-button>
|
|
> 批量删除</a-button>
|
|
<span>已选{{ selectTotalInfo.selectNum }}项,数量合计{{ selectTotalInfo.selProductNum }}个,售价合计{{ selectTotalInfo.selTotalPrice }}元</span>
|
|
<span>已选{{ selectTotalInfo.selectNum }}项,数量合计{{ selectTotalInfo.selProductNum }}个,售价合计{{ selectTotalInfo.selTotalPrice }}元</span>
|
|
</div>
|
|
</div>
|
|
@@ -81,7 +82,7 @@
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import { accumulatedProductsList } from '@/api/salesDetailNew'
|
|
|
|
|
|
+import { accumulatedProductsList, deleteBatchBorrow } from '@/api/salesDetailNew'
|
|
export default {
|
|
export default {
|
|
name: 'TotalProductDetailModal',
|
|
name: 'TotalProductDetailModal',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -139,8 +140,8 @@ export default {
|
|
const selectNum = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
const selectNum = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
let selProductNum = 0
|
|
let selProductNum = 0
|
|
let selTotalPrice = 0
|
|
let selTotalPrice = 0
|
|
- if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys) {
|
|
|
|
- this.rowSelectionInfo.selectedRowKeys.forEach(item => {
|
|
|
|
|
|
+ if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows) {
|
|
|
|
+ this.rowSelectionInfo.selectedRows.forEach(item => {
|
|
selProductNum += item.num
|
|
selProductNum += item.num
|
|
selTotalPrice += item.price
|
|
selTotalPrice += item.price
|
|
})
|
|
})
|
|
@@ -170,6 +171,34 @@ export default {
|
|
this.queryParam.targetName = undefined
|
|
this.queryParam.targetName = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.clearSelected() // 清空表格选中项
|
|
this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
|
+ },
|
|
|
|
+ // 删除 批量删除
|
|
|
|
+ handleDel (row) {
|
|
|
|
+ const ajaxData = {
|
|
|
|
+ salesBillSn: this.parameter.salesBillSn,
|
|
|
|
+ salesBillDetailSnList: []
|
|
|
|
+ }
|
|
|
|
+ if (row) {
|
|
|
|
+ ajaxData.salesBillDetailSnList = [row.salesPromoSn]
|
|
|
|
+ } else {
|
|
|
|
+ if (!(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys && this.rowSelectionInfo.selectedRowKeys.length)) {
|
|
|
|
+ this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ ajaxData.salesBillDetailSnList = this.rowSelectionInfo.selectedRowKeys
|
|
|
|
+ }
|
|
|
|
+ this.confirmDel(ajaxData)
|
|
|
|
+ },
|
|
|
|
+ // 确定删除
|
|
|
|
+ confirmDel (ajaxData) {
|
|
|
|
+ this.spinning = true
|
|
|
|
+ deleteBatchBorrow(ajaxData).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success('删除成功')
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|