预入库的删除功能

This commit is contained in:
2026-01-22 08:48:51 +08:00
parent 7788434c8d
commit bbb777f273
2 changed files with 63 additions and 8 deletions

View File

@@ -78,11 +78,12 @@
}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="220">
<el-table-column label="操作" align="center" fixed="right" width="260">
<template #default="scope">
<el-button link type="primary" @click="picDetailFun(scope.row.billNo, 0, 1)">入库图片</el-button>
<el-button link type="primary" @click="billClick(scope.row, 'bill', 'rk')">入库单</el-button>
<el-button link type="primary" @click="editData(scope.row)">修改</el-button>
<el-button link type="primary" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -127,6 +128,9 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleOneClickStockDelete">一键撤销</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Delete" @click="handleOneClickStockDel">一键删除</el-button>
</el-col>
</el-row>
<el-table v-loading="detailLoading" show-overflow-tooltip border :data="stockList"
@selection-change="printSelectionChange">
@@ -598,12 +602,14 @@ import {
listBill,
addBill,
updateBill,
delBill,
listStock,
appendBill,
moveRecord,
updateRecord,
backoutRecord,
recordFinish
recordFinish,
recordRemove
} from "@/api/wisdom/bill";
import {
uploadContract,
@@ -1116,6 +1122,14 @@ function editForm() {
});
}
// 删除单据
const delData = (row) => {
delBill([row.id]).then((response) => {
proxy.$modal.msgSuccess("删除成功");
getList();
});
}
//双击单据,查询明细
const billDoubleClickObj = ref({});
const detailLoading = ref(false); //加载列表详情
@@ -1296,6 +1310,7 @@ const handleStockDelete = (row) => {
})
.catch(() => { });
};
// 一键撤销
const handleOneClickStockDelete = (row) => {
if (checkStockList.value.length == 0) {
@@ -1322,6 +1337,27 @@ const handleOneClickStockDelete = (row) => {
});
};
// 一键删除
const handleOneClickStockDel = () => {
if (checkStockList.value.length == 0) {
proxy.$modal.msgError("请勾选数据");
return;
}
if (checkStockList.value.some(item => item.execStatus == 1)) {
proxy.$modal.msgError("已入库数据不能删除");
return;
}
const ids = checkStockList.value.map(item => item.id)
recordRemove(ids).then((response) => {
if (response.code == 200) {
proxy.$modal.msgSuccess("操作成功");
detailList();
} else {
proxy.$modal.msgError("操作失败");
}
});
};
// 一键入库