forked from integrated_whb/integrated_whb_vue
刪除清單管理
parent
f4490f70b7
commit
ff680ec1de
|
@ -95,3 +95,10 @@ export const setCheckStandardSupplementaryRecordingSubmit = (params) =>
|
|||
post("/customCheckrecord/recording", params); // 隐患排查清单检查情况检查记录补录提交
|
||||
export const setCheckStandardSubmit = (params) =>
|
||||
post("/customCheckrecord/add", params); // 清单排查提交
|
||||
|
||||
export const getDeleteCustomList = (params) => post("/customStop/list", params); // 删除清单管理列表
|
||||
export const setDeleteCustomRecovery = (params) =>
|
||||
post("/customStop/restore", params); // 删除清单管理恢复
|
||||
export const setCustomBatchDelete = (params) =>
|
||||
post("/customStop/deleteAll", params); // 清单管理批量删除
|
||||
export const getCustomStopView = (params) => post("/customStop/goEdit", params); // 清单管理查看
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
:data="list"
|
||||
v-model:pagination="pagination"
|
||||
@get-data="fnGetDataTransfer"
|
||||
row-key="LISTMANAGER_ID"
|
||||
:row-key="name === 'risk' ? LISTMANAGER_ID : CUSTOM_ID"
|
||||
>
|
||||
<el-table-column reserve-selection type="selection" width="55" />
|
||||
<el-table-column label="序号" width="70">
|
||||
|
@ -140,7 +140,10 @@
|
|||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/delete_inventory_management/view',
|
||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||
query:
|
||||
name === 'risk'
|
||||
? { ID: row.LISTMANAGER_ID, type: '1' }
|
||||
: { ID: row.CUSTOM_ID, type: '2' },
|
||||
})
|
||||
"
|
||||
>
|
||||
|
@ -150,7 +153,11 @@
|
|||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="fnRecovery(row.LISTMANAGER_ID)"
|
||||
@click="
|
||||
name === 'risk'
|
||||
? fnRecovery(row.LISTMANAGER_ID)
|
||||
: fnRecovery(row.CUSTOM_ID)
|
||||
"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
|
@ -184,24 +191,29 @@ import {
|
|||
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||
import { useUserStore } from "@/pinia/user.js";
|
||||
import {
|
||||
getDeleteCustomList,
|
||||
getDeleteInventoryManagementList,
|
||||
setCustomBatchDelete,
|
||||
setDeleteCustomRecovery,
|
||||
setDeleteInventoryManagementRecovery,
|
||||
setInventoryManagementBatchDelete,
|
||||
} from "@/request/hazard_investigation.js";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
defineProps({
|
||||
const tabName = defineProps({
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
||||
useListData(getDeleteInventoryManagementList, {
|
||||
LIST_TYPE: name === "risk" ? "1" : "2",
|
||||
});
|
||||
tabName.name === "risk"
|
||||
? useListData(getDeleteInventoryManagementList)
|
||||
: useListData(getDeleteCustomList);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||
const buttonJurisdiction = await useButtonJurisdiction("stoplistmanager");
|
||||
|
@ -220,9 +232,14 @@ const fnResetPaginationTransfer = () => {
|
|||
};
|
||||
const fnRecovery = debounce(
|
||||
1000,
|
||||
async (LISTMANAGER_ID) => {
|
||||
async (ID) => {
|
||||
await ElMessageBox.confirm("确定要恢复吗?", { type: "warning" });
|
||||
await setDeleteInventoryManagementRecovery({ LISTMANAGER_ID });
|
||||
if (tabName.name === "risk") {
|
||||
await setDeleteInventoryManagementRecovery({ ID });
|
||||
} else {
|
||||
await setDeleteCustomRecovery({ ID });
|
||||
}
|
||||
|
||||
ElMessage.success("恢复成功");
|
||||
fnResetPaginationTransfer();
|
||||
},
|
||||
|
@ -240,8 +257,15 @@ const fnBatchDelete = debounce(
|
|||
"删除之后该清单无法恢复,确认要删除选中的数据吗?",
|
||||
{ type: "warning" }
|
||||
);
|
||||
const DATA_IDS = selectionData.map((item) => item.LISTMANAGER_ID).join(",");
|
||||
if (tabName.name === "risk") {
|
||||
const DATA_IDS = selectionData
|
||||
.map((item) => item.LISTMANAGER_ID)
|
||||
.join(",");
|
||||
await setInventoryManagementBatchDelete({ DATA_IDS });
|
||||
} else {
|
||||
const DATA_IDS = selectionData.map((item) => item.CUSTOM_ID).join(",");
|
||||
await setCustomBatchDelete({ DATA_IDS });
|
||||
}
|
||||
ElMessage.success("删除成功");
|
||||
fnResetPaginationTransfer();
|
||||
},
|
||||
|
|
|
@ -53,14 +53,26 @@
|
|||
<script setup>
|
||||
import { useRoute } from "vue-router";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { getInventoryManagementView } from "@/request/hazard_investigation.js";
|
||||
import {
|
||||
getCustomStopView,
|
||||
getInventoryManagementView,
|
||||
} from "@/request/hazard_investigation.js";
|
||||
import { ref } from "vue";
|
||||
|
||||
const route = useRoute();
|
||||
const { LISTMANAGER_ID } = route.query;
|
||||
const { ID, type } = route.query;
|
||||
const info = ref({});
|
||||
const { list } = useListData(getInventoryManagementView, {
|
||||
otherParams: { LISTMANAGER_ID },
|
||||
const { list } =
|
||||
type === "1"
|
||||
? useListData(getInventoryManagementView, {
|
||||
otherParams: { LISTMANAGER_ID: ID },
|
||||
usePagination: false,
|
||||
callbackFn: (list, resData) => {
|
||||
info.value = resData.pd;
|
||||
},
|
||||
})
|
||||
: useListData(getCustomStopView, {
|
||||
otherParams: { CUSTOM_ID: ID },
|
||||
usePagination: false,
|
||||
callbackFn: (list, resData) => {
|
||||
info.value = resData.pd;
|
||||
|
|
|
@ -382,9 +382,9 @@ const fnDisable = debounce(
|
|||
async (ID) => {
|
||||
await ElMessageBox.confirm("确定要禁用吗?", { type: "warning" });
|
||||
if (tabName.name === "risk") {
|
||||
await setInventoryManagementDisable({ ID });
|
||||
await setInventoryManagementDisable({ LISTMANAGER_ID: ID });
|
||||
} else {
|
||||
await setCustomDisable({ ID });
|
||||
await setCustomDisable({ CUSTOM_ID: ID });
|
||||
}
|
||||
ElMessage.success("禁用成功");
|
||||
fnResetPaginationTransfer();
|
||||
|
|
Loading…
Reference in New Issue