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