169 库房管理-》采购管理-》采购管理:选中采购管理中的数据,点击删除报错,已解决,并新增批量删除功能

This commit is contained in:
liuliu
2026-03-10 18:07:07 +08:00
parent 39b608dfd0
commit 066c457d90
7 changed files with 133 additions and 73 deletions

View File

@@ -551,7 +551,7 @@
<script setup name="InventoryReceiptDialog">
import {
addPurchaseinventory,
addPurchaseInventory,
delPurchaseinventory,
getCount,
getDispensaryList,
@@ -755,7 +755,7 @@ function handleClickOutside(event) {
function saveRow(row, index) {
form.purchaseinventoryList[index] = row;
addPurchaseinventory(row).then((response) => {
addPurchaseInventory(row).then((response) => {
reset();
data.isAdding = false; // 允许新增下一行
proxy.$message.success('保存成功!');
@@ -846,7 +846,7 @@ function handleSave(row, index) {
if (valid) {
proxy.$refs['formRef'].validate((valid) => {
if (valid) {
addPurchaseinventory(row).then((res) => {
addPurchaseInventory(row).then((res) => {
// 当前行没有id视为首次新增
if (!row.id) {
data.isAdding = false; // 允许新增下一行

View File

@@ -19,7 +19,7 @@ export function getpurchaseInventoryDetail(busNo) {
}
// 添加/编辑入库单据
export function addPurchaseinventory(data) {
export function addPurchaseInventory(data) {
return request({
url: '/inventory-manage/purchase/inventory-receipt',
method: 'put',
@@ -45,7 +45,7 @@ export function getInitBusNo() {
}
// 删除单据
// 删除单据(根据供应请求 ID
export function delPurchaseinventory(param) {
return request({
url: '/inventory-manage/purchase/inventory-receipt?supplyRequestIds=' + param,
@@ -53,6 +53,14 @@ export function delPurchaseinventory(param) {
})
}
// 删除单据(根据单据号)
export function delPurchaseinventoryByBusNo(busNoList) {
return request({
url: '/inventory-manage/purchase/inventory-receipt-by-bus-no?busNoList=' + busNoList,
method: 'delete',
})
}
// 提交审批
export function submitApproval(busNo) {
return request({

View File

@@ -396,7 +396,7 @@
<script setup name="Purchaseinventory">
import {
delPurchaseinventory,
delPurchaseinventoryByBusNo,
generatedReturnDetail,
getInit,
getpurchaseInventoryDetail,
@@ -644,18 +644,14 @@ function handleSelectionChangeReturn(selection) {
}
/** 删除按钮操作 */
function handleDelete(row) {
let length = selectedRows.value.length;
let ids = [];
if (selectedRows.value[0].id) {
ids = selectedRows.value.map((item) => {
return item.id;
});
}
const deleteIds = selectedRows.value.map((item) => item.supplierId).join(',');
// 获取选中行的单据号列表
const busNoList = selectedRows.value.map((item) => item.supplyBusNo);
proxy.$modal
.confirm('是否确认删除以上数据?')
.then(function () {
return delPurchaseinventory(ids);
// 调用后端接口,根据单据号删除
return delPurchaseinventoryByBusNo(busNoList);
})
.then(() => {
getList();