huminmin
2 天以前 75d99a1160ca9bc5e13590b769b7b8f793b698ff
库存管理和采购管理增加删除
已修改3个文件
99 ■■■■ 文件已修改
src/api/warehouseManagement/index.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procureMent/index.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManagement/index.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/warehouseManagement/index.js
@@ -9,6 +9,13 @@
        params: query
    })
}
export function batchDeletePendingInventoryByIds(ids) {
    return request({
        url: '/pendingInventory/delPending',
        method: 'delete',
        data: ids
    })
}
// 查询正式入库管理列表
export function officialInventoryList(query) {
    return request({
@@ -17,6 +24,13 @@
        params: query
    })
}
export function batchDeleteOfficialInventoryByIds(ids) {
    return request({
        url: '/officialInventory/delete',
        method: 'delete',
        data: ids
    })
}
// All煤质方案查询
export function coalPlanList(query) {
    return request({
src/views/procureMent/index.vue
@@ -20,9 +20,9 @@
        <el-button type="primary" :icon="Plus" @click="handleAdd"
          >新建
        </el-button>
        <!-- <el-button type="danger" :icon="Delete" @click="handleDelete"
        <el-button type="danger" :icon="Delete" @click="handleDelete"
          >删除
        </el-button> -->
        </el-button>
      </el-row>
      <!-- 表格组件 -->
      <data-table
@@ -258,15 +258,30 @@
  addOrEdit.value = "viewRow";
  handleAddEdit();
};
// 使用删除组合式函数 - 简化版本
const { handleDeleteBatch: handleDelete } = useDelete({
  deleteApi: delPR,
  selectedRows,
  tableData,
  total,
  confirmText: "确定删除选中的采购记录吗?",
  useLocalUpdate: true
});
const handleDelete = () => {
  if (selectedRows.value.length === 0) {
    proxy.$modal.msgWarning("请选择要删除的数据");
    return;
  }
  proxy.$modal
      .confirm("是否要删除" +`选中的${selectedRows.value.length}条数据?`)
      .then((res) => {
        if (res) {
          delPR(selectedRows.value.map((row) => row.id)).then((res) => {
            if (res.result.code === 200) {
              proxy.$modal.msgSuccess("删除成功");
              getList();
            } else {
              proxy.$modal.msgError("删除失败:" + res.result.msg);
            }
          }).finally(() => {
            handleQuery()
          })
        }
      })
      .catch(() => {})
}
const handleDeleteSuccess = (row) => {
  ElMessage.success("删除成功:" + row.supplierName);
    handleQuery()
src/views/warehouseManagement/index.vue
@@ -41,7 +41,7 @@
      </el-tabs>
      <!-- 操作按钮区 -->
      <el-space>
        <!--        <el-button type="danger" :icon="Delete">删除</el-button>-->
        <el-button type="danger" :icon="Delete" @click="batchDelete(type)">删除</el-button>
        <!-- <el-button type="info" plain :icon="Download">导出</el-button>  -->
        <el-button
          type="success"
@@ -474,8 +474,11 @@
  coalPlanList,
  officialInventoryList,
  pendingInventoryList,
  batchDeletePendingInventoryByIds,
  batchDeleteOfficialInventoryByIds,
  editOfficial,
  merge
} from "@/api/warehouseManagement/index.js";
import { editOfficial, merge } from "../../api/warehouseManagement/index.js";
import { getSupplyList } from "@/api/procureMent/index.js";
import { getCoalInfoList } from "@/api/production/index.js";
import { ElMessage } from "element-plus";
@@ -555,7 +558,8 @@
// 标签页数据
const tabs = reactive([
  { name: "pendingInbound", label: "待入库" },
  { name: "officialInventory", label: "正式库存" },
  { name: "officialInventory", label: "烟煤库存" },
  { name: "officialInventory", label: "型煤库存" },
]);
// 查询参数
const queryParams = reactive({
@@ -739,6 +743,44 @@
    `${new Date().getTime()}${name}${new Date().toLocaleDateString("en-CA")}.xlsx`
  );
};
const batchDelete = () => {
  if (selectedRows.value.length === 0) {
    proxy.$modal.msgWarning("请选择要删除的数据");
    return;
  }
  proxy.$modal
    .confirm("是否要删除" +`选中的${selectedRows.value.length}条数据?`)
    .then((res) => {
      if (res) {
        deleteData();
      }
    })
    .catch(() => {});
};
// 删除库存数据方法
const deleteData = () => {
  if (activeTab.value === "pendingInbound") {
    batchDeletePendingInventoryByIds(selectedRows.value.map((row) => row.id)).then((res) => {
      if (res.result.code === 200) {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      } else {
        proxy.$modal.msgError("删除失败:" + res.result.msg);
      }
    });
  } else {
    batchDeleteOfficialInventoryByIds(selectedRows.value.map((row) => row.id)).then((res) => {
      if (res.result.code === 200) {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      } else {
        proxy.$modal.msgError("删除失败:" + res.result.msg);
      }
    })
  }
  handleQuery()
};
// 合并库存数据方法
const mergeRows = (type, row) => {
  getDropdownData();