|
@@ -34,12 +34,15 @@
|
|
|
</trade-card>
|
|
|
<trade-card title="仓储费明细">
|
|
|
<avue-crud :option="option" :data="form.storageFeesItemsList" id="out-table" ref="crud"
|
|
|
- @resetColumn="resetColumn('crud', 'option', 'optionBack', 443)"
|
|
|
+ @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 443)"
|
|
|
@saveColumn="saveColumn('crud', 'option', 'optionBack', 443)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="primary" size="small" @click="addRow"
|
|
|
:disabled="editButton || form.status == '已生成'">计算仓储费
|
|
|
</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="allDel"
|
|
|
+ :disabled="editButton || form.status == '已生成'||selectionList.length==0">批量删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<!-- <el-button size="small" icon="el-icon-edit" type="text"
|
|
@@ -151,6 +154,8 @@ export default {
|
|
|
menu: true,
|
|
|
refreshBtn: false,
|
|
|
align: 'center',
|
|
|
+ tip: false,
|
|
|
+ selection: true,
|
|
|
column: [
|
|
|
{
|
|
|
label: "合同号",
|
|
@@ -225,6 +230,7 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ selectionList: [],
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -251,14 +257,14 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- let ids=[]
|
|
|
- ids=this.form.storageFeesItemsList.map(item => item.id)
|
|
|
+ let ids = []
|
|
|
+ ids = this.form.storageFeesItemsList.map(item => item.id)
|
|
|
itemRemove({ ids: ids.join(',') }).then(res => {
|
|
|
- this.form.storageFeesItemsList=[]
|
|
|
+ this.form.storageFeesItemsList = []
|
|
|
this.getData()
|
|
|
this.$message.success("操作成功!");
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
if (this.form.storageFeesItemsList.length == 0) {
|
|
@@ -287,8 +293,44 @@ export default {
|
|
|
loading.close()
|
|
|
})
|
|
|
},
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list
|
|
|
+ },
|
|
|
allDel() {
|
|
|
-
|
|
|
+ let multiList = []
|
|
|
+ let arr = []
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ multiList = this.selectionList
|
|
|
+ arr = this.form.storageFeesItemsList
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.id != null);
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 把选中的删除掉
|
|
|
+ multiList.forEach((item) => {
|
|
|
+ for (let index in arr) {
|
|
|
+ if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
+ arr.splice(Number(index), 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ itemRemove({ ids: arrIds.join(',') }).then(res => {
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 编辑
|
|
|
inEdit() {
|