qb 7 months ago
parent
commit
6b0f504cd9
  1. 52
      src/views/cost/Deliverycostmanagement/Deliverymaintenancecosts.vue

52
src/views/cost/Deliverycostmanagement/Deliverymaintenancecosts.vue

@ -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>

Loading…
Cancel
Save