Files
xzlz_JczWeb/src/views/backOfficeSystem/peopleManag/checkpoint/index.vue

210 lines
5.6 KiB
Vue
Raw Normal View History

2025-06-02 20:25:19 +08:00
<template>
<div>
<div class="titleBox">
2025-06-23 09:57:34 +08:00
<PageTitle title="环林卡口管理">
2025-07-07 20:49:08 +08:00
<el-button type="primary" @click="addEdit('add', '')" v-if="Auth">
2025-07-08 14:56:56 +08:00
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle" @click="addEdit('add', row)">新增</span>
2025-06-02 20:25:19 +08:00
</el-button>
</PageTitle>
</div>
<!-- 表格 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" />
</div>
<div class="tabBox">
2025-07-08 14:56:56 +08:00
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
@chooseData="chooseData">
2025-06-02 20:25:19 +08:00
<template #jczlx="{ row }">
<dict-tag :value="row.jczlx" :options="D_BZ_JCZLX" :tag="false" />
</template>
<template #zqlx="{ row }">
<dict-tag :options="D_BZ_ZQLX" :value="row.zqlx" :tag="false" />
</template>
<template #jczjb="{ row }">
<dict-tag :options="D_BZ_JCZJB" :value="row.jczjb" :tag="false" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
2025-07-08 14:56:56 +08:00
<template v-if="Auth">
2025-07-07 20:49:08 +08:00
<el-link type="primary" @click="addEdit('edit', row)">修改</el-link>
<el-link type="primary" @click="delDictItem(row.id)">删除</el-link>
</template>
<el-link type="primary" @click="addEdit('detail', row)">详情</el-link>
2025-06-02 20:25:19 +08:00
</template>
</MyTable>
2025-07-08 14:56:56 +08:00
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
2025-06-02 20:25:19 +08:00
</div>
<!-- 编辑详情 -->
2025-07-08 14:56:56 +08:00
<EditAddForm ref="detailDiloag" :dict="{ D_BZ_JCZLX, D_BZ_ZQLX, D_BZ_DLLX, D_BZ_JCZJB }"
@getjczgetXfllList="getjczgetXfllList" />
2025-06-02 20:25:19 +08:00
</div>
</template>
<script setup>
2025-07-08 14:56:56 +08:00
import { ElMessage } from "element-plus";
2025-06-02 20:25:19 +08:00
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import EditAddForm from "./components/editAddForm.vue";
import { JczselectJczList, JczdeleteById } from "@/api/mosty-jcz.js";
2025-07-08 14:56:56 +08:00
import { isAuth } from '@/utils/tools.js'
2025-06-02 20:25:19 +08:00
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
const { D_BZ_JCZLX, D_BZ_ZQLX, D_BZ_DLLX, D_BZ_JCZJB } = proxy.$dict(
"D_BZ_JCZLX",
"D_BZ_ZQLX",
"D_BZ_DLLX",
"D_BZ_JCZJB"
);
const searchConfiger = ref([
{
showType: "department",
prop: "ssbmdm",
placeholder: "请选择所属部门",
label: "所属部门"
},
{
2025-06-23 09:57:34 +08:00
label: "环林卡口名称",
2025-06-02 20:25:19 +08:00
prop: "jczmc",
2025-06-23 09:57:34 +08:00
placeholder: "请输入环林卡口名称",
2025-06-02 20:25:19 +08:00
showType: "input"
},
{
label: "执勤类型",
prop: "zqlx",
placeholder: "请选择执勤类型",
showType: "select",
options: D_BZ_ZQLX
},
{
2025-06-23 09:57:34 +08:00
label: "环林卡口类型",
2025-06-02 20:25:19 +08:00
prop: "jczlx",
2025-06-23 09:57:34 +08:00
placeholder: "请选择环林卡口类型",
2025-06-02 20:25:19 +08:00
showType: "select",
options: D_BZ_JCZLX
}
]);
const detailDiloag = ref();
const pageData = reactive({
tableData: [], //表格数据
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
}, //分页
controlsWidth: 250, //操作栏宽度
tableColumn: [
{ label: "所属部门", prop: "ssbm", showOverflowTooltip: true },
2025-06-23 09:57:34 +08:00
{ label: "环林卡口名称", prop: "jczmc", showOverflowTooltip: true },
2025-06-02 20:25:19 +08:00
{
2025-06-23 09:57:34 +08:00
label: "环林卡口类型",
2025-06-02 20:25:19 +08:00
prop: "jczlx",
showOverflowTooltip: true,
showSolt: true
},
{
label: "执勤类型",
prop: "zqlx",
showSolt: true,
showOverflowTooltip: true
},
{
2025-06-23 09:57:34 +08:00
label: "环林卡口地址",
2025-07-07 20:49:08 +08:00
prop: "xxdz",
2025-06-02 20:25:19 +08:00
showOverflowTooltip: true
}
]
});
2025-07-08 14:56:56 +08:00
const Auth = ref(true)
2025-06-02 20:25:19 +08:00
onMounted(() => {
2025-07-07 20:49:08 +08:00
Auth.value = isAuth()
2025-06-02 20:25:19 +08:00
tabHeightFn();
});
//查询条件
const queryCondition = ref({});
// 获取数据
const getjczgetXfllList = () => {
pageData.tableConfiger.loading = true;
const promes = { ...queryCondition.value, ...pageData.pageConfiger };
JczselectJczList(promes)
.then((res) => {
pageData.tableData = res.records;
pageData.total = res.total;
})
.finally(() => {
pageData.tableConfiger.loading = false;
});
};
getjczgetXfllList();
// 搜索
const onSearch = (val) => {
queryCondition.value = { ...queryCondition.value, ...val };
getjczgetXfllList();
};
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
};
// 获取列表
// 删除
const delDictItem = (ids) => {
proxy
.$confirm("确定删除该数据?", "警告", { type: "warning" })
.then(() => {
2025-07-08 14:56:56 +08:00
JczdeleteById(ids).then((res) => {
2025-06-02 20:25:19 +08:00
ElMessage({ message: "删除成功", type: "success" });
pageData.pageConfiger.pageCurrent = 1;
getjczgetXfllList();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
};
// 新增
const addEdit = (type, row) => {
detailDiloag.value.init(type, row);
};
const searchBox = ref(null);
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight =
window.innerHeight - searchBox.value.offsetHeight - 280;
window.onresize = function () {
tabHeightFn();
};
};
</script>
<style>
.el-loading-mask {
background: rgba(0, 0, 0, 0.5) !important;
}
</style>