|
|
|
@ -20,11 +20,19 @@
|
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '操作'"> |
|
|
|
|
<div class="eml_btn"> |
|
|
|
|
|
|
|
|
|
<span |
|
|
|
|
class="el_btn_a" |
|
|
|
|
@click="newlyadded(slotProps)" |
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
<el-icon style="color: #409eff"><CirclePlus /></el-icon>新增 |
|
|
|
|
</span> |
|
|
|
|
<span class="el_btn_a"> |
|
|
|
|
<el-icon style="color: #409eff; margin-right: 3px"><CirclePlus /></el-icon>编辑 |
|
|
|
|
<el-icon style="color: #409eff"><Edit /></el-icon>编辑 |
|
|
|
|
</span> |
|
|
|
|
<span @click="categoriesduceSurcharge(slotProps.scope.row.index)" class="el_btn_b"> |
|
|
|
|
<el-icon style="color: #f00; margin-right: 3px"><Delete /></el-icon>删除 |
|
|
|
|
<span @click="categoriesduceSurcharge(slotProps.scope.row.index)" class="el_btn_a"> |
|
|
|
|
<el-icon style="color: #f00"><Delete /></el-icon>删除 |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -40,7 +48,7 @@ const activeName = ref('Commercialdistribution');
|
|
|
|
|
const form = ref({ |
|
|
|
|
dispatchSubjoinCategoryData: [ |
|
|
|
|
{ |
|
|
|
|
index: 1, |
|
|
|
|
index: 0, |
|
|
|
|
Warehousecategory: '', |
|
|
|
|
options: [], |
|
|
|
|
loading: false, |
|
|
|
@ -65,7 +73,30 @@ const search = value => {
|
|
|
|
|
console.log(value); |
|
|
|
|
}; |
|
|
|
|
const handleClick = () => {}; |
|
|
|
|
const categoriesduceSurcharge = () => {}; |
|
|
|
|
const categoriesduceSurcharge = (row) => { |
|
|
|
|
console.log(row, '要删除的数组下标'); |
|
|
|
|
console.log(form.value.dispatchSubjoinCategoryData, 'form.value.dispatchSubjoinCategoryData'); |
|
|
|
|
|
|
|
|
|
// 删除数组中指定下标的对象 |
|
|
|
|
form.value.dispatchSubjoinCategoryData.splice(row -1, 1); |
|
|
|
|
|
|
|
|
|
// 重新排序 |
|
|
|
|
form.value.dispatchSubjoinCategoryData.forEach((item, index) => { |
|
|
|
|
item.index = index + 1; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
console.log(form.value.dispatchSubjoinCategoryData, 'form.value.dispatchSubjoinCategoryData after deletion and reordering'); |
|
|
|
|
}; |
|
|
|
|
const newlyadded = row => { |
|
|
|
|
console.log(row, 'row'); |
|
|
|
|
let data = { |
|
|
|
|
index: form.value.dispatchSubjoinCategoryData.length +1, |
|
|
|
|
Warehousecategory: '', |
|
|
|
|
options: [], |
|
|
|
|
loading: false, |
|
|
|
|
}; |
|
|
|
|
form.value.dispatchSubjoinCategoryData.push(data); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
@ -87,4 +118,15 @@ const categoriesduceSurcharge = () => {};
|
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.eml_btn { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-around; |
|
|
|
|
align-items: center; |
|
|
|
|
.el_btn_a { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin: 0 3px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|