diff --git a/src/api/wisdom/bill.js b/src/api/wisdom/bill.js index 979e18a..c14e3a3 100644 --- a/src/api/wisdom/bill.js +++ b/src/api/wisdom/bill.js @@ -44,6 +44,15 @@ export function appendBill(data) { }) } +// 删除库存单据 +export function delBill(data) { + return request({ + url: '/wisdom/bill/delete', + method: 'delete', + data: data + }) +} + // 移库 export function moveRecord(data) { return request({ @@ -70,6 +79,7 @@ export function backoutRecord(data) { data: data }) } + // 一键入库 export function recordFinish(data) { return request({ @@ -79,6 +89,15 @@ export function recordFinish(data) { }) } +// 一键删除预入库 +export function recordRemove(data) { + return request({ + url: '/wisdom/record/delete', + method: 'delete', + data: data + }) +} + @@ -105,12 +124,12 @@ export function recordFinish(data) { // 删除库存单据 -export function delBill(id) { - return request({ - url: '/wisdom/bill/' + id, - method: 'delete' - }) -} +// export function delBill(id) { +// return request({ +// url: '/wisdom/bill/' + id, +// method: 'delete' +// }) +// } // 查询库存单据详细 // export function getBill(id) { diff --git a/src/views/wisdom/bill/index.vue b/src/views/wisdom/bill/index.vue index 84bfcfb..78cfe20 100644 --- a/src/views/wisdom/bill/index.vue +++ b/src/views/wisdom/bill/index.vue @@ -78,11 +78,12 @@ }} - + @@ -127,6 +128,9 @@ 一键撤销 + + 一键删除 + @@ -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("操作失败"); + } + }); +}; + // 一键入库