'保安项目提交'

This commit is contained in:
esacpe
2025-09-22 09:01:41 +08:00
commit 21e2a12e3c
1439 changed files with 336271 additions and 0 deletions

View File

@ -0,0 +1,88 @@
<template>
<div>
<div class="titleBox">
<div class="title">巡防辅警</div>
<div class="btnBox">
<!-- <el-button type="primary" @click="isShowPolice = false">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">分组管理</span>
</el-button> -->
<el-button type="primary" @click="isShowPolice = true" v-if="!isShowPolice">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">返回</span>
</el-button>
<el-button type="primary" @click="addPolice">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">新增 </span>
</el-button>
<el-button @click="batchDelete" :disabled="ids.length == 0" typeof="danger">
<el-icon style="vertical-align: middle">
<Delete />
</el-icon>
<span style="vertical-align: middle">批量删除</span>
</el-button>
<el-button type="info" v-if="isShowPolice" plain icon="Upload" @click="isImport = true">
<span style="vertical-align: middle">导入</span>
</el-button>
</div>
</div>
<div>
<PoliceF v-if="isShowPolice" ref="policeComponnet" @deleteMore="deleteMore" />
<PoliceGroup ref="groupComponnet" v-else @deleteMore="deleteMore" />
</div>
<!-- 导入 -->
<Export :show="isImport" lx="policeF" @closeImport="isImport = false" @handleImport="handleImport" />
</div>
</template>
<script setup>
import Export from "@/components/export/index.vue";
import PoliceF from "./policeF.vue";
import PoliceGroup from "./policeGroup.vue";
import { nextTick, ref } from "vue";
const ids = ref([]);
const policeComponnet = ref(null);
const groupComponnet = ref(null);
const isShowPolice = ref(true);
const isImport = ref(false);
// 新增
function addPolice() {
if (isShowPolice.value) {
policeComponnet.value.add();
} else {
groupComponnet.value.init();
}
}
function deleteMore(val) {
ids.value = val;
}
// 批量删除
function batchDelete() {
if (isShowPolice.value) {
policeComponnet.value.batchDelete();
} else {
groupComponnet.value.batchDelete();
}
}
// 确定上传
function handleImport(val) {
policeComponnet.value.handleFilter();
}
</script>
<style lang="scss" scoped>
@import "@/assets/css/layout.scss";
@import "@/assets/css/element-plus.scss";
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,357 @@
<template>
<div>
<div class="searchBox" ref="searchBox">
<el-form :model="form" :inline="true">
<el-form-item label="分组名称">
<el-input v-model="form.jzmc" placeholder="请输入姓名" clearable />
</el-form-item>
<el-form-item>
<el-button type="success" @click="handleFilter"> 查询 </el-button>
<el-button type="info" @click="reset()"> 重置 </el-button>
</el-form-item>
</el-form>
</div>
<div class="tabBox">
<el-table
:data="tableData"
border
ref="dataTreeList"
row-key="id"
style="width: 100%"
@selection-change="handleSelectionChange"
:height="tableHeight"
:key="keyCount"
v-loading="loadingTable"
element-loading-background="rgba(0,0,0,0.3)"
element-loading-text="数据加载中"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column label="序号" type="index" align="center" width="80" />
<el-table-column
prop="jzmc"
show-overflow-tooltip
align="center"
width="200"
label="分组名称"
/>
<el-table-column label="分组成员" prop="jzry">
<template #default="{ row }">
<span class="xmTag" v-for="item in row.jzry" :key="item.id">{{
item.xm
}}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="150px"
fixed="right"
>
<template #default="{ row }">
<el-button @click="onClickUpdate(row.id)" size="small"
>修改</el-button
>
<el-button @click="delDictItem(row)" type="danger" size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="fenye" :style="{ top: tableHeight + 'px' }">
<el-pagination
class="pagination"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="form.pageCurrent"
:page-sizes="[10, 20, 50]"
:page-size="form.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
<div v-if="openDialog" class="dialog">
<div class="head_box">
<span class="title">{{ title }}</span>
<div>
<el-button
type="primary"
size="small"
@click="submit"
:loading="loading"
>保存</el-button
>
<el-button size="small" @click="openDialog = false">关闭</el-button>
</div>
</div>
<el-form
ref="elform"
:model="addForm"
:rules="rules"
:inline="true"
label-position="top"
>
<el-form-item label="分组名称" prop="jzmc">
<el-input
v-model="addForm.jzmc"
placeholder="请输入分组名称"
clearable
style="width: 100%"
/>
</el-form-item>
<el-form-item label="分组成员" prop="jzry" style="width: 100%">
<div class="ipt" @click.stop="fjVisible = true">
<el-tag
v-for="tag in fjData"
:key="tag.id"
class="mx-1"
closable
:type="tag.type"
@close="handleClosefj(tag)"
>
{{ tag.xm }}
</el-tag>
</div>
</el-form-item>
</el-form>
</div>
<!-- 辅警弹唱 -->
<FjLoad
v-model="fjVisible"
:Single="false"
@choosedUsers="hanlderChooseFj"
/>
</div>
</template>
<script setup>
import { qcckPost, qcckGet, qcckPut } from "@/api/qcckApi.js";
import FjLoad from "@/components/MyComponents/ChooseJz/FjLoad.vue";
import { selectDeptPage, getUserInfoToId } from "@/api/user-manage";
import { ElMessage } from "element-plus";
import {
ref,
reactive,
onMounted,
computed,
defineExpose,
defineEmits,
getCurrentInstance
} from "vue";
const emit = defineEmits(["deleteMore"]);
const { proxy } = getCurrentInstance();
const searchBox = ref(null); // 搜索盒子
//筛选条件参数
const formDefault = ref({});
const form = ref({
pageCurrent: 1,
pageSize: 20
});
const tableHeight = ref(); // 表格高度
const tableHeight1 = ref(); // 表格高度
const tableData = ref([]); //表单数据
const keyCount = ref(0); //tabel组件刷新值
const loadingTable = ref(false);
const title = ref("新增分组");
const openDialog = ref(false); //打开弹窗
const total = ref(0); //总数据
const isDisabled = ref(false); //是否警用保存按钮
const loading = ref(false); //按钮是否显示加载
const ids = ref([]); //批量删除的ID
//新增表单参数
const elform = ref(null); //表单对象
const addFormDefault = ref({});
const addForm = ref({});
//新增表单验证数据
const rules = reactive({
jzmc: [{ required: true, message: "请输入分组名称", trigger: "blur" }]
});
const fjData = ref([]); //选择的辅警数据
const fjVisible = ref(false); //辅警弹窗
onMounted(() => {
addFormDefault.value = JSON.parse(JSON.stringify(addForm.value));
formDefault.value = JSON.parse(JSON.stringify(form.value));
tabHeightFn();
window.onresize = function () {
tabHeightFn();
};
handleFilter(); //查询数据
});
function init() {
addForm.value = JSON.parse(JSON.stringify(addFormDefault.value));
openDialog.value = true;
}
//点击查询
const handleFilter = () => {
form.value.pageCurrent = 1;
getListData();
};
//获取数据
const getListData = () => {
loadingTable.value = true;
qcckGet(form.value, "/mosty-jmxf/tbJcglXfllFz")
.then((res) => {
loadingTable.value = false;
res.records.forEach((element) => {
element.jzry = JSON.parse(element.jzry);
});
tableData.value = res.records;
total.value = res.total;
})
.catch(() => {
loadingTable.value = false;
});
};
//选择辅警
function hanlderChooseFj(arr) {
fjData.value = arr;
addForm.value.jzry = JSON.stringify(fjData.value);
}
// 删除辅警
function handleClosefj(tag) {
fjData.value.splice(fjData.value.indexOf(tag), 1);
addForm.value.jzry = JSON.stringify(fjData.value);
}
//批量数据
const handleSelectionChange = (val) => {
ids.value = val.map((item) => {
return item.id;
});
emit("deleteMore", ids.value);
};
//更改查询条数
function handleSizeChange(e) {
form.value.pageSize = e;
form.value.pageCurrent = 1;
getListData();
}
//分页查询
function handleCurrentChange(e) {
form.value.pageCurrent = e;
getListData();
}
//新增提交
function submit() {
elform.value.validate((valid) => {
if (valid) {
loading.value = true;
if (title.value == "编辑分组") {
qcckPut(addForm.value, "/mosty-jmxf/tbJcglXfllFz")
.then((res) => {
ElMessage({ message: "修改成功", type: "success" });
openDialog.value = false;
loading.value = false;
handleFilter();
})
.catch(() => {
loading.value = false;
});
} else {
addForm.value.jzry = JSON.stringify(fjData.value);
qcckPost(addForm.value, "/mosty-jmxf/tbJcglXfllFz")
.then((res) => {
ElMessage({ message: "添加成功", type: "success" });
openDialog.value = false;
loading.value = false;
handleFilter();
})
.catch(() => {
loading.value = false;
});
}
}
});
}
//重置搜索
function reset() {
form.value = JSON.parse(JSON.stringify(formDefault.value));
getListData();
}
//点击修改打开弹窗
function onClickUpdate(id) {
title.value = "编辑分组";
qcckGet({}, "/mosty-jmxf/tbJcglXfllFz/" + id).then((res) => {
addForm.value = res;
fjData.value = JSON.parse(res.jzry);
openDialog.value = true;
});
}
//删除人员
function delDictItem(e) {
proxy
.$confirm("确定要删除", "警告", {
type: "warning"
})
.then(() => {
deletEate(e.id);
})
.catch(() => {
proxy.$message.info("已取消");
});
}
//批量删除数据
const batchDelete = () => {
proxy
.$confirm("确定要删除", "警告", {
type: "warning"
})
.then(() => {
deletEate(ids.value);
})
.catch(() => {
proxy.$message.info("已取消");
});
};
function deletEate(data) {
qcckPost(data, "/mosty-jmxf/tbJcglXfllFz/deleteList").then((res) => {
ElMessage({
message: "删除成功",
type: "success"
});
getListData();
});
}
// 表格高度计算
const tabHeightFn = () => {
tableHeight.value = window.innerHeight - searchBox.value.offsetHeight - 240;
};
defineExpose({
batchDelete,
init
});
</script>
<style lang="scss" scoped>
@import "@/assets/css/layout.scss";
@import "@/assets/css/element-plus.scss";
.ipt {
border: 1px solid rgb(7, 85, 188);
width: 100%;
line-height: 32px;
min-height: 32px;
border-radius: 4px;
}
.xmTag {
border: 1px solid rgb(7, 85, 188);
padding: 1px 6px;
margin: 0 4px;
border-radius: 4px;
white-space: nowrap;
}
</style>

View File

@ -0,0 +1,119 @@
<template>
<div class="patrol-line-dialog">
<el-dialog v-model="isShow" :title="title" width="800px" :show-close="true" :center="true"
:before-close="handleClose">
<div class="uplodBox">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="80px">
<el-form-item prop="xm" label="姓名">
<el-input v-model="formData.xm" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="lxdh" label="联系电话">
<el-input v-model="formData.lxdh" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item prop="zjhm" label="身份证号">
<el-input v-model="formData.zjhm" placeholder="请输入身份证号"></el-input>
</el-form-item>
<el-form-item prop="jzdz" label="居住地址">
<el-input v-model="formData.jzdz" placeholder="请输入居住地址"></el-input>
</el-form-item>
<el-form-item prop="wpdw" label="外派单位">
<el-input v-model="formData.wpdw" placeholder="请输入外派单位"></el-input>
</el-form-item>
<el-form-item prop="csmc" label="场所名称">
<el-input v-model="formData.csmc" placeholder="请输入场所名称"></el-input>
</el-form-item>
<el-form-item prop="csdm" label="场所代码">
<el-input v-model="formData.csdm" placeholder="请输入场所代码"></el-input>
</el-form-item>
</el-form>
</div>
<div class="foot tc">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" :loading="loading" @click="onComfirm">确认</el-button>
</div>
</el-dialog>
</div>
</template>
<script setup>
import * as rule from "@/utils/rules.js";
import { ElMessage } from "element-plus";
import { qcckPost, qcckGet } from "@/api/qcckApi.js";
import { reactive, ref } from "vue";
const emit = defineEmits(['refresh'])
const isShow = ref(false);
const formData = ref({});
const title = ref('')
const rules = reactive({
jzdz: [{ required: true, message: "请输入居住地址", trigger: "blur" }],
wpdw: [{ required: true, message: "请输入外派单位", trigger: "blur" }],
xm: [{ required: true, message: "请输入姓名", trigger: "blur"}],
...rule.phoneRule({ validator: true,message: "请输入联系电话",require: true }, "lxdh"), // 是否必填 是否进行校验`
...rule.identityCardRule({ validator: true,message: "请输入身份证号" ,require: true}, "zjhm"), // 是否必填 是否进行校验
});
const loading = ref(false)
const formRef = ref()
// 关闭弹窗
function handleClose() {
isShow.value = false;
formData.value = {};
formRef.value.resetFields();
}
// 提交
function onComfirm (){
formRef.value.validate((valid) => {
if (!valid) return;
loading.value = true;
let params = { ...formData.value }
let url = title.value == '新增' ? '/mosty-jmxf/tbbary/add' : '/mosty-jmxf/tbbary/update';
qcckPost(params, url).then((res) => {
ElMessage({ message: "保存成功", type: "success", });
loading.value = false;
emit('refresh')
handleClose();
}).catch(() => {
loading.value = false;
})
});
}
const init = (type,row) => {
title.value = type == 'add' ? '新增' : '编辑';
isShow.value = true;
if(row){
qcckGet({id:row.id},'/mosty-jmxf/tbbary/selectByid').then((res) => {
formData.value = res;
})
}
}
defineExpose({init})
</script>
<style lang="scss" scoped>
.tagBox {
width: 100%;
min-height: 24px;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 2px 5px;
box-sizing: border-box;
.txet {
color: #999;
font-size: 14px;
}
}
</style>
<style lang="scss">
.patrol-line-dialog {
.el-date-editor .el-range-separator {
color: #333 !important;
}
}
</style>

View File

@ -0,0 +1,159 @@
<template>
<div>
<div class="titleBox">
<PageTitle title="保安人员" />
<el-button type="primary" @click="addEdit('add', null)">新增</el-button>
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch"></Search>
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
<template #gw="{ row }">
<dict-tag :options="D_BAXX_GWLX" :value="row.gw" :tag="false" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
<el-link type="primary" @click="addEdit('edit', row)">编辑</el-link>
<el-link type="danger" @click="handleDelete(row.id)">删除</el-link>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
</div>
<!-- 新增编辑 -->
<AddDialog ref="addEditDialog" @refresh="getList"></AddDialog>
</div>
</template>
<script setup>
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 AddDialog from "./components/addDialog.vue";
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance();
const { D_BAXX_GWLX } = proxy.$dict("D_BAXX_GWLX");
const addEditDialog = ref();
const searchBox = ref(); //搜索框
const searchConfiger = ref([
{
label: "姓名",
prop: "xm",
placeholder: "请输入姓名",
showType: "input"
},
{
label: "证件号码",
prop: "sfzh",
placeholder: "请输入证件号码",
showType: "input"
},
]);
const queryFrom = ref({});
const pageData = reactive({
tableData: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false,
haveControls:false,
},
haveControls: false,
total: 5,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 180,
tableColumn: [
{ label: "姓名", prop: "xm" },
{ label: "联系电话", prop: "lxdh" },
{ label: "证件号码", prop: "sfzh" },
{ label: "场所名称", prop: "csmc" },
{ label: "岗位", prop: "gw", showSolt: true },
{ label: "入职时间", prop: "rzsj" },
]
});
onMounted(() => {
getList();
tabHeightFn();
});
// 搜索
const onSearch = (val) => {
queryFrom.value = { ...val };
pageData.pageConfiger.pageCurrent = 1;
getList();
};
const changeNo = (val) => {
pageData.pageConfiger.pageNum = val;
getList();
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList();
};
// 获取列表
const getList = () => {
pageData.tableConfiger.loading = true;
let data = { ...pageData.pageConfiger, ...queryFrom.value };
qcckGet(data, "/mosty-jmxf/tbbary/cyryPage").then((res) => {
pageData.tableData = res.records || [];
pageData.total = res.total;
pageData.tableConfiger.loading = false;
}).catch(() => {
pageData.tableConfiger.loading = false;
});
};
// 详情
const addEdit = (type, row) => {
addEditDialog.value.init(type, row);
};
// 删除
const handleDelete = (id) => {
proxy.$confirm("确认删除该记录吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(() => {
qcckPost({ id }, "/mosty-jmxf/tbbary/delete").then((res) => {
proxy.$message({ type: "success", message: "删除成功!" });
getList();
}).catch(() => {
pageData.tableConfiger.loading = false;
});
});
};
// 下发
const handleXfrw = (row) => {
addEditDialog.value.init(row);
}
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight =
window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () {
tabHeightFn();
};
};
</script>
<style>
.el-loading-mask {
background: rgba(0, 0, 0, 0.5) !important;
}
</style>

View File

@ -0,0 +1,569 @@
<template>
<div>
<div class="titleBox">
<div class="title">经验管理</div>
<div class="btnBox">
<el-button type="primary" @click="addLoad">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">新增</span>
</el-button>
<el-button
@click="batchDelete"
:disabled="ids.length == 0"
typeof="danger"
>
<el-icon style="vertical-align: middle">
<Delete />
</el-icon>
<span style="vertical-align: middle">批量注销</span>
</el-button>
</div>
</div>
<div class="searchBox" ref="searchBox">
<el-form :model="form" :inline="true">
<el-form-item label="经验名称">
<el-input
v-model="form.bqmc"
placeholder="请输入经验名称"
clearable
style="width: 100%"
/>
</el-form-item>
<el-form-item>
<el-button type="success" @click="handleFilter"> 查询 </el-button>
<el-button type="info" @click="reset()"> 重置 </el-button>
</el-form-item>
</el-form>
</div>
<div class="tabBox">
<el-table
:data="tableData"
border
@selection-change="handleSelectionChange"
row-key="id"
:tree-props="{ children: 'itemList', hasChildren: true }"
style="width: 100%"
:height="tableHeight"
:key="keyCount"
v-loading="loadingTable"
element-loading-background="rgba(0,0,0,0.3)"
element-loading-text="数据加载中"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column
label="序号"
type="index"
align="center"
sortable
width="80"
/>
<el-table-column
sortable
prop="bqbh"
show-overflow-tooltip
align="center"
width="150px"
label="经验编号"
>
</el-table-column>
<el-table-column
sortable
prop="bqmc"
show-overflow-tooltip
align="center"
width="350px"
label="经验名称"
>
</el-table-column>
<el-table-column sortable label="经验人员" align="center">
<template #default="{ row }">
<span class="textBtn" @click="info(row)">{{ row.xfllSl }}</span>
</template>
</el-table-column>
<el-table-column width="150" label="数据状态" align="center">
<template #default="{ row }">
<el-tag size="small" type="success" v-if="row.xtSjzt != 0"
>正常</el-tag
>
<el-tag size="small" type="danger" v-else>注销</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="mxId" show-overflow-tooltip label="计算模型" align="center" width="200px">
</el-table-column> -->
<el-table-column
label="操作"
align="center"
fixed="right"
width="200px"
>
<template #default="{ row }">
<!-- <el-button size="small" @click="setInfo(row.id)">详情</el-button> -->
<el-button @click="update(row.id)" size="small" v-if="row.xtSjzt != 0">修改</el-button>
<el-button @click="delDictItem(row.id)" v-if="row.xtSjzt != 0" type="danger" size="small"
>注销</el-button
>
</template>
</el-table-column>
</el-table>
<div class="fenye" :style="{ top: tableHeight + 'px' }">
<el-pagination
class="pagination"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="form.pageCurrent"
:page-sizes="[10, 20, 50]"
:page-size="form.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
<div v-if="dialogFormVisible" class="dialog">
<div class="head_box">
<span class="title">{{ diaTitle }}</span>
<div>
<el-button
type="primary"
size="small"
@click="submit"
v-if="!isDisabled"
:loading="loading"
>保存</el-button
>
<el-button size="small" @click="dialogFormVisible = false"
>关闭</el-button
>
</div>
</div>
<el-form
ref="elform"
:rules="rules"
:model="addForm"
:inline="true"
label-position="top"
>
<el-form-item label="经验编号" prop="bqbh">
<el-input
readonly
v-model="addForm.bqbh"
placeholder="请输入经验编号"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="经验名称" prop="bqmc">
<el-input
v-model="addForm.bqmc"
:readonly="disable"
placeholder="请输入经验名称"
clearable
style="width: 100%"
/>
</el-form-item>
<div style="width: 100%" v-if="xfllActive">
<el-tabs
style="width: 100%"
v-model="activeName"
type="card"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tab-pane label="民警" name="mj"></el-tab-pane>
<el-tab-pane label="辅警" name="fj"></el-tab-pane>
</el-tabs>
<el-table
:data="xfllDtata"
border
row-key="id"
:tree-props="{ children: 'itemList', hasChildren: true }"
style="width: 100%"
height="400px"
:key="keyCount"
>
<el-table-column
label="序号"
type="index"
align="center"
sortable
width="80"
/>
<el-table-column
sortable
prop="xm"
show-overflow-tooltip
align="center"
:label="activeName == 'mj' ? '民警姓名' : '辅警姓名'"
>
</el-table-column>
<el-table-column
sortable
prop="sfzh"
show-overflow-tooltip
align="center"
label="身份证号码"
>
</el-table-column>
<el-table-column
sortable
prop="ssbm"
label="所属部门"
align="center"
></el-table-column>
<el-table-column
sortable
prop="jh"
label="警号"
align="center"
></el-table-column>
</el-table>
<el-pagination
class="pagination"
@size-change="handleSizeChangexf"
@current-change="handleCurrentChangexf"
:current-page="xfllQuery.current"
:page-sizes="[10, 20, 50]"
:page-size="xfllQuery.size"
layout="total, sizes, prev, pager, next, jumper"
:total="xfllTotal"
>
</el-pagination>
</div>
</el-form>
</div>
</div>
</template>
<script setup>
import {
getTbJcglBq,
addTbJcglBq,
putTbJcglBq,
infoTbJcglBq,
delTbJcglBq,
deleteTbJcglBq
} from "@/api/basicsmanage/experience";
import { getTbJcglXfll } from "@/api/xfll";
import { ref, reactive, onMounted, getCurrentInstance, onUnmounted } from "vue";
const { proxy } = getCurrentInstance();
const xfllActive = ref(false);
const ids = ref([]); //批量注销的ID
const activeName = ref("mj");
//巡防力量数据
const xfllDtata = ref([]);
//巡防力量查询参数
const xfllQuery = ref({
current: 1,
size: 20,
fl: "01"
});
const xfllTotal = ref(0);
const tableData = ref([]); //表单数据
const total = ref(0); //总数据
const dialogFormVisible = ref(false); //是否显示新增弹窗
const elform = ref({}); //表单对象
const loadingTable = ref(true);
const chackadd = ref(true); //切换新增修改
const disable = ref(false);
const searchBox = ref(null); // 搜索盒子
const diaTitle = ref("新增经验管理");
const isDisabled = ref(false); //是否警用保存按钮
const loading = ref(false); //按钮是否显示加载
const keyCount = ref(0); //tabel组件刷新值
//赛选条件参数
const form = ref({
pageCurrent: 1,
pageSize: 20,
bqmc: "",
bqlx: "EXP"
});
//新增表单参数
const addForm = ref({
id: "",
bqbh: "",
bqmc: "",
bqlx: "EXP"
});
function addLoad() {
xfllActive.value = false;
addForm.value = {
bqbh: "JY" + repairZero(total.value + 1),
bqmc: "",
bqlx: "EXP"
};
isDisabled.value = false;
disable.value = false;
chackadd.value = true;
diaTitle.value = "新增经验管理";
dialogFormVisible.value = true;
}
//表单验证
const rules = reactive({
bqmc: [
{
required: true,
message: "请输入经验名称"
}
]
// mxId: [
// {
// required: true
// }
// ]
});
const tableHeight = ref(); // 表格高度
//批量数据
const handleSelectionChange = (val) => {
ids.value = [];
if (val) {
val.forEach((item) => {
ids.value.push(item.id);
});
}
};
//批量注销数据
const batchDelete = () => {
proxy
.$confirm("确定要注销", "警告", {
type: "warning"
})
.then(() => {
deleteTbJcglBq(ids.value).then((res) => {
proxy.$message({
type: "success",
message: "注销成功"
});
getListData();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
};
onMounted(() => {
tabHeightFn();
getListData();
window.onresize = function () {
tabHeightFn();
};
proxy.mittBus.on("mittFn", (data) => {
keyCount.value = data;
});
});
onUnmounted(() => {
proxy.mittBus.off("mittFn");
});
//补0函数
function repairZero(num) {
let data = num;
if (1 <= num < 10) {
data = "000" + num;
} else if (10 <= num < 100) {
data = "00" + num;
} else if (100 <= num < 1000) {
data = "0" + num;
}
return data;
}
//获取巡防力量数据
function getXfll() {
let data = {
fl: xfllQuery.value.fl,
pageSize: xfllQuery.value.size,
pageCurrent: xfllQuery.value.current,
bqId: xfllQuery.value.bqId || ""
};
getTbJcglXfll(data).then((res) => {
xfllDtata.value = res.records;
xfllTotal.value = res.total;
});
}
//更改查询条数
function handleSizeChange(e) {
form.value.pageSize = e;
form.value.pageCurrent = 1;
getListData();
}
function handleClick() {
if (activeName.value == "mj") {
xfllQuery.value.fl = "01";
getXfll();
} else {
xfllQuery.value.fl = "02";
getXfll();
}
}
//分页查询
function handleCurrentChange(e) {
form.value.pageCurrent = e;
getListData();
}
//查看详情
function setInfo(id) {
infoTbJcglBq(id).then((res) => {
disable.value = true;
diaTitle.value = res.bqmc + "经验详情";
addForm.value = res;
dialogFormVisible.value = true;
isDisabled.value = true;
});
}
//修改
function update(id) {
infoTbJcglBq(id).then((res) => {
disable.value = false;
isDisabled.value = false;
chackadd.value = false;
diaTitle.value = res.bqmc + "经验修改";
addForm.value = res;
dialogFormVisible.value = true;
});
if (e.xfllSl == 0) {
xfllActive.value = false;
} else {
xfllActive.value = true;
xfllQuery.value.bqId = id;
getXfll();
}
}
function info(row) {
infoTbJcglBq(row.id).then((res) => {
disable.value = false;
isDisabled.value = false;
chackadd.value = false;
diaTitle.value = res.bqmc + "经验修改";
addForm.value = res;
dialogFormVisible.value = true;
});
if (row.xfllSl == 0) {
xfllActive.value = false;
} else {
xfllActive.value = true;
xfllQuery.value.bqId = row.id;
getXfll();
}
}
//新增提交
function submit() {
loading.value = true;
setTimeout(() => {
loading.value = false;
}, 1.5e3);
elform.value.validate((valid) => {
if (valid) {
let data = addForm.value;
if (!chackadd.value) {
putTbJcglBq(data).then((res) => {
proxy.$message({
type: "success",
message: "修改成功"
});
dialogFormVisible.value = false;
getListData();
});
} else {
addTbJcglBq(data).then(() => {
proxy.$message({
type: "success",
message: "新增成功"
});
dialogFormVisible.value = false;
getListData();
});
}
}
});
}
//删除
function delDictItem(id) {
// 删除数据用
// delTbJcglBq(id).then((res) => {
proxy
.$confirm("确定要注销", "警告", {
type: "warning"
})
.then(() => {
deleteTbJcglBq([id]).then(() => {
proxy.$message({
type: "success",
message: "注销成功"
});
getListData();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
}
//更改查询条数xfll
function handleSizeChangexf(e) {
activeName.size = e;
xfllQuery.value.current = 1;
getXfll();
}
//分页查询xfll
function handleCurrentChangexf(e) {
xfllQuery.value.current = e;
getListData();
getXfll();
}
//点击查询
const handleFilter = () => {
form.value.pageCurrent = 1;
getListData();
};
//获取数据
const getListData = () => {
loadingTable.value = true;
const params = form.value;
getTbJcglBq(params).then((res) => {
tableData.value = res.records;
total.value = res.total;
loadingTable.value = false;
}).catch(()=>{
loadingTable.value = false;
});
};
//重置查询条件
const reset = () => {
form.value = {
pageCurrent: 1,
pageSize: 20,
bqmc: "",
bqlx: "EXP"
};
getListData();
};
// 表格高度计算
const tabHeightFn = () => {
tableHeight.value = window.innerHeight - searchBox.value.offsetHeight - 240;
};
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
::v-deep .el-tabs--card > .el-tabs__header {
border-bottom: 1px solid #03438b;
}
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #03438b;
}
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 1px solid #03438b;
border-bottom: none;
border-radius: 4px 4px 0 0;
box-sizing: border-box;
}
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item {
border-left: 1px solid #234c9e;
}
.textBtn {
cursor: pointer;
}
.textBtn:hover {
color: #2a5dc2;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,460 @@
<template>
<div>
<!-- 详情列表 -->
<el-dialog
title="人员档案管理"
width="1400px"
:model-value="peopleValue"
:close-on-click-modal="false"
:destroy-on-close="true"
@close="closed"
>
<div class="cntBox">
<div class="cntbox-title one-border">{{dataValue.xm }}个人综合档案</div>
<div class="cntInfo">
<div class="left">
<div class="img">
<img src="@\assets\images\default_male.png" alt="" />
</div>
</div>
<ul class="right">
<li class="rightItem">
<div class="text">姓名</div>
<div class="info">{{ dataValue.xm }}</div>
<div class="text">性别</div>
<div class="info">{{ dataValue.xbmc }}</div>
</li>
<li class="rightItem">
<div class="text">身份证号</div>
<div class="info">{{ dataValue.sfzh }}</div>
<div class="text">年领</div>
<div class="info">{{ dataValue.age }}</div>
</li>
<li class="rightItem">
<div class="text">联系电话</div>
<div class="info">{{ dataValue.lxdh }}</div>
<div class="text">警号</div>
<div class="info">{{ dataValue.jh }}</div>
</li>
<li class="rightItem">
<div class="text">所属单位</div>
<div class="info">{{ dataValue.ssbm }}</div>
<div class="text">家庭地址</div>
<div class="info">{{ dataValue.ssbm }}</div>
</li>
<li class="rightItem">
<div class="text">入职时间</div>
<div class="info"></div>
<div class="text">籍贯</div>
<div class="info">{{ dataValue.jgdm }}</div>
</li>
<li class="rightItem">
<div class="text">民族</div>
<div class="info">{{ dataValue.mzmc }}</div>
<div class="text">学历</div>
<div class="info"></div>
</li>
<li class="rightItem">
<div class="text">婚姻状况</div>
<div class="info"></div>
<div class="text">政治面貌</div>
<div class="info"></div>
</li>
<li class="rightItem">
<div class="text">特殊技能</div>
<div class="infoText"></div>
</li>
</ul>
</div>
<div class="cntbox-title two-border">训练档案</div>
<div class="buns">
<el-button @click="add_edit('', 'add')">新增</el-button>
</div>
<el-table
:data="tableData"
border
row-key="id"
width="100%"
element-loading-background="rgba(0,0,0,0.3)"
>
<el-table-column
label="序号"
type="index"
align="center"
width="80"
/>
<el-table-column label="训练日期" prop="xlrq" align="center" />
<el-table-column label="训练类型" prop="xllx" align="center">
<template #default="{ row }">
<dict-tag
:options="props.D_BZ_XFXLLX"
:value="row.xllx"
:tag="false"
/>
</template>
</el-table-column>
<el-table-column label="训练时长(H)" prop="xlsc" align="center" />
<el-table-column label="训练层级" prop="xlcj" align="center">
<template #default="{ row }">
<dict-tag
:options="props.D_BZ_XLCJ"
:value="row.xlcj"
:tag="false"
/>
</template>
</el-table-column>
<el-table-column label="备注" prop="bz" align="center" />
<el-table-column label="操作" align="center" fixed="right">
<template #default="{ row }">
<el-button @click="add_edit(row, 'edit')" size="small"
>修改</el-button
>
<el-button @click="delDictItem(row.id)" type="danger" size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="closed">取消</el-button>
<!-- <el-button type="primary" @click="onComfirm">确认</el-button> -->
</div>
</template>
</el-dialog>
<!-- 添加-编辑- 训练记录 -->
<el-dialog
:title="titleValue"
width="400px"
:model-value="recordsValue"
:close-on-click-modal="false"
:destroy-on-close="true"
>
<el-form
ref="elform"
:model="addForm"
:rules="rules"
:inline="true"
label-position="right"
:label-width="120"
>
<el-form-item label="训练日期" prop="xlrq">
<el-date-picker
style="width: 100%"
v-model="addForm.xlrq"
unlink-panels
placeholder="请选择"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item label="训练时长(h)" prop="xlsc">
<el-input
v-model="addForm.xlsc"
placeholder="请输入训练时长(h)"
clearable
style="width: 100%"
/>
</el-form-item>
<el-form-item label="训练类型 " prop="xllx">
<el-select
clearable
v-model="addForm.xllx"
placeholder="请选择训练类型"
style="width: 100%"
>
<el-option
v-for="(item, index) in D_BZ_XFXLLX"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="训练层级" prop="xlcj">
<el-select
clearable
v-model="addForm.xlcj"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="(item, index) in D_BZ_XLCJ"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeAdd">取消</el-button>
<el-button type="primary" :loading="loading" @click="submit"
>确认</el-button
>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup >
import {
ref,
defineExpose,
reactive,
onMounted,
getCurrentInstance
} from "vue";
import {tbJcglXfAdd,tbJcglSelectPage,tbJcglDelete,tbJcglEdit} from '@/api/xfll.js'
import { IdCard } from "@/utils/validate.js";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
const props = defineProps({
D_BZ_XB: Array,
D_BZ_MZ: Array,
D_BZ_XLCJ: Array,
D_BZ_XFXLLX: Array
});
const peopleValue = ref(false);
const recordsValue = ref(false); //新增
const dataValue = ref({});
const elform = ref(null); //表单对象
const loading = ref(false);
const titleValue = ref("");
const addFormDefault = ref({});
const addForm = ref({
xlrq: "",
xlsc: "",
xllx: "",
xlcj: ""
}); //训练档案表单
const tableData = ref([]); //训练档案
const rules = reactive({
xlrq: [
{
required: true,
message: "请选择训练日期"
}
],
xlsc: [
{
required: true,
message: "请输入训练时长(h)"
}
],
xllx: [
{
required: true,
message: "请选择训练类型"
}
],
xlcj: [
{
required: true,
message: "请选择训练层级"
}
]
});
onMounted(() => {
addFormDefault.value = JSON.parse(JSON.stringify(addForm.value));
});
// 初始化
function init(row) {
peopleValue.value = true;
row.age = IdCard(row.sfzh, 3);
let sex = props.D_BZ_XB.find((v) => {
return v.value == row.xbdm;
});
row.xbmc = sex ? sex.label : "";
let origin = props.D_BZ_MZ.find((v) => {
return v.value == row.mzdm;
});
row.mzmc = origin ? origin.label : "";
dataValue.value = row;
getDetail(dataValue.value.id);
}
// 查询记录数据
function getDetail(id) {
tbJcglSelectPage({ ryid: id }).then((res) => {
tableData.value = res;
});
}
// 新增-编辑
function add_edit(row, type) {
recordsValue.value = true;
if (type == "add") {
titleValue.value = "新增";
} else {
titleValue.value = "编辑";
addForm.value = Object.assign(row);
}
}
//新增提交
function submit() {
elform.value.validate((valid) => {
if (valid) {
loading.value = true;
let params = {
...addForm.value,
ryid: dataValue.value.id
};
if (titleValue.value == "新增") {
tbJcglXfAdd(params)
.then((res) => {
loading.value = false;
ElMessage({ message: "新增成功", type: "success" });
closeAdd();
getDetail(dataValue.value.id);
})
.catch(() => {
loading.value = false;
});
}
if (titleValue.value == "编辑") {
tbJcglEdit(addForm.value)
.then((res) => {
ElMessage({ message: "编辑成功", type: "success" });
closeAdd();
getDetail(dataValue.value.id);
})
.catch(() => {
loading.value = false;
}).finally(() => {
loading.value = false;
});
}
}
});
}
// 关闭新增弹窗
function closeAdd() {
addForm.value = JSON.parse(JSON.stringify(addFormDefault.value));
recordsValue.value = false;
}
//删除人员
function delDictItem(id) {
let ids = [id];
proxy
.$confirm("确定要删除", "警告", { type: "warning" })
.then(() => {
tbJcglDelete(ids).then((res) => {
ElMessage({ message: "删除成功", type: "success" });
getDetail(dataValue.value.id);
});
})
.catch((err) => {
console.log(err);
proxy.$message.info("已取消");
});
}
// 关闭弹窗
function closed() {
peopleValue.value = false;
dataValue.value = {};
}
defineExpose({ init });
</script>
<style lang="scss" scoped>
@mixin boderLine() {
border: 1px solid #136bff;
}
.cntBox {
width: 100%;
height: 64vh;
overflow: hidden;
overflow-y: auto;
color: #fff;
.cntbox-title {
line-height: 40px;
font-size: 16px;
text-align: center;
}
.one-border {
border-bottom: none;
}
.two-border {
@include boderLine;
border-top: none;
}
.cntInfo {
display: flex;
.left {
width: 400px;
@include boderLine;
border-right: none;
position: relative;
.img {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
margin: auto;
width: 180px;
height: 220px;
background: #ccc;
img {
width: 180px;
max-height: 220px;
}
}
}
@mixin boderc() {
min-height: 40px;
line-height: 26px;
color: rgb(27, 189, 238);
border-right: 1px solid #136bff;
border-left: 1px solid #136bff;
}
.right {
flex: 1;
.rightItem {
display: flex;
align-items: center;
@include boderLine;
border-bottom: none;
border-right: none;
div {
height: 100%;
text-align: center;
}
.text {
width: 200px;
color: #000;
}
.info {
width: calc((100% - 400px) / 2);
@include boderc;
}
.infoText {
width: calc(100% - 200px);
@include boderc;
}
}
.rightItem:last-child {
border-bottom: 1px solid #136bff;
}
}
}
.buns {
text-align: right;
padding: 8px 6px;
}
}
</style>

View File

@ -0,0 +1,311 @@
<template>
<div>
<div class="titleBox">
<div class="title">群防群治人员</div>
<div class="btnBox">
<el-button type="primary" @click="add">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">新增</span>
</el-button>
<!-- <el-button @click="batchDelete" :disabled="ids.length == 0" typeof="danger">
<el-icon style="vertical-align: middle">
<Delete />
</el-icon>
<span style="vertical-align: middle">批量注销</span>
</el-button> -->
</div>
</div>
<div class="searchBox" ref="searchBox">
<el-form :model="form" :inline="true">
<el-form-item label="姓名">
<el-input v-model="form.xm" placeholder="姓名" clearable style="width: 100%" />
</el-form-item>
<el-form-item>
<el-button @click="handleFilter"> 查询 </el-button>
<el-button @click="reset()"> 重置 </el-button>
</el-form-item>
</el-form>
</div>
<div class="tabBox">
<el-table :data="tableData" border row-key="id" :tree-props="{ children: 'itemList', hasChildren: true }"
style="width: 100%" :height="tableHeight" :key="keyCount"
v-loading="loadingTable" element-loading-background="rgba(0,0,0,0.3)" element-loading-text="数据加载中。。">
<!-- <el-table-column type="selection" width="40" align="center" /> -->
<el-table-column label="序号" type="index" align="center" sortable width="80" />
<el-table-column sortable prop="xm" show-overflow-tooltip align="center" width="250px" label="姓名">
</el-table-column>
<el-table-column sortable prop="sjh" show-overflow-tooltip align="center" width="350px" label="手机号码">
</el-table-column>
<el-table-column sortable prop="sfzh" show-overflow-tooltip align="center" width="350px" label="人员身份证号">
</el-table-column>
<el-table-column label="人员类型" align="center">
<template #default="{ row }">
<span class="textBtn" v-if="row.rylx == '01'">群众</span>
<span class="textBtn" v-if="row.rylx == '02'">党员</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200px">
<template #default="{ row }">
<el-button @click="setInfo(row, 'edit')" size="small" >修改</el-button>
<el-button @click="setInfo(row, 'detail')" size="small">详情</el-button>
<el-button @click="delDictItem(row.id)" type="danger" size="small">注销</el-button>
</template>
</el-table-column>
</el-table>
<div class="fenye" :style="{ top: tableHeight + 'px' }">
<el-pagination class="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="form.current" :page-sizes="[10, 20, 50]" :page-size="form.size"
layout="total, sizes, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
<div v-if="dialogFormVisible" class="dialog">
<div class="head_box">
<span class="title">{{ title }}</span>
<div>
<el-button type="primary" size="small" @click="submit" v-if="!isDisabled" :loading="loading">保存</el-button>
<el-button size="small" @click="close()">关闭</el-button>
</div>
</div>
<el-form ref="felform" :rules="rules" :model="addForm" :inline="true" :disabled="isDisabled" label-position="top">
<el-form-item label="姓名" prop="xm">
<el-input v-model="addForm.xm" placeholder="请输入姓名" style="width: 100%" />
</el-form-item>
<el-form-item label="人员类型" prop="rylx" >
<el-select v-model="addForm.rylx" placeholder="请选择人员类型" clearable>
<el-option label="群众" value="01"></el-option>
<el-option label="党员" value="02"></el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号码" prop="sjh">
<el-input v-model="addForm.sjh" placeholder="请输入手机号码" style="width: 100%" />
</el-form-item>
<el-form-item label="身份证号码" prop="sfzh">
<el-input v-model="addForm.sfzh" placeholder="请输入身份证号码" style="width: 100%" />
</el-form-item>
</el-form>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance } from "vue";
import { ElMessage } from "element-plus";
import { qfqzAdd, qfqzEdit,qfqzSelectPage,qfqzDelete } from '@/api/lz/backstage'
const { proxy } = getCurrentInstance();
const searchBox = ref(null); // 搜索盒子
const loadingTable = ref(true);
const tableHeight = ref(); // 表格高度
const title = ref("新增专业技能");
//查询参数
const form = ref({
current: 1,
size: 20,
});
//新增表单参数
const addForm = ref({});
//表单验证
const rules = reactive({
xm: [
{
required: true,
message: "请输入姓名"
}
],
rylx: [
{
required: true,
message: "请选择人员类型"
},
],
sjh: [
{
required: true,
message: "请输入手机号码"
}
],
sfzh: [
{
required: true,
message: "请输入身份证号码"
}
],
});
const tableData = ref([]); //表单数据
const total = ref(0); //总数据
const dialogFormVisible = ref(false); //是否打开新增弹窗
const felform = ref({}); //表当对象
const isDisabled = ref(false); //是否警用保存按钮
const loading = ref(false); //是否显示按钮加载
const checkAdd = ref(false);
const keyCount = ref(0); //tabel组件刷新值
onMounted(() => {
getListData();
tabHeightFn();
window.onresize = function () {
tabHeightFn();
};
});
onUnmounted(() => {
proxy.mittBus.off("mittFn");
});
//查看详情
function setInfo(e, type) {
addForm.value = { ...e };
dialogFormVisible.value = true;
if (type == 'detail') {
isDisabled.value = true;
checkAdd.value =false
title.value = "群防群治人员详情";
} else {
title.value = "修改群防群治人员";
checkAdd.value =false
isDisabled.value = false
}
}
function add() {
isDisabled.value = false;
checkAdd.value = true;
title.value = "新增群防群治人员";
dialogFormVisible.value = true;
}
//新增提交
function submit() {
loading.value = true;
felform.value.validate((valid) => {
if (valid) {
let data = addForm.value;
if (!checkAdd.value) {
qfqzEdit(data).then((res) => {
ElMessage({
message: "修改成功",
type: "success"
});
getListData();
}).finally(() => {
loading.value = false;
});
} else {
qfqzAdd(data).then((res) => {
ElMessage({
message: "添加成功",
type: "success"
});
getListData();
}).finally(() => {
loading.value = false;
});
}
dialogFormVisible.value = false;
}
});
}
//点击查询
const handleFilter = () => {
form.value.current = 1;
getListData();
};
//获取数据
const getListData = () => {
loadingTable.value = true;
let data = {
pageSize: form.value.size,
pageCurrent: form.value.current,
xm: form.value.xm,
};
qfqzSelectPage(data)
.then((res) => {
tableData.value = res.records;
total.value = res.total;
loadingTable.value = false;
})
.catch(() => {
loadingTable.value = false;
});
};
//修改查询条件
const delDictItem = (id) => {
proxy
.$confirm("确定要删除", "警告", { type: "warning" })
.then(() => {
qfqzDelete(id).then(() => {
proxy.$message({ type: "success", message: "删除成功" });
getListData();
}) .catch(() => {console.log("报错");
});
})
.catch((err) => {console.log(err);
});
}
//更改查询条数
function handleSizeChange(e) {
form.value.size = e;
form.value.current = 1;
getListData();
}
//分页查询
function handleCurrentChange(e) {
xfllQuery.value.current = e;
}
//点击重置
const reset = () => {
form.value = {
current: 1,
size: 20,
textName: ""
};
getListData();
};
const close = () => {
addForm.value = {};
dialogFormVisible.value = false
}
// 表格高度计算
const tabHeightFn = () => {
tableHeight.value = window.innerHeight - searchBox.value.offsetHeight - 240;
};
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
::v-deep .el-tabs--card>.el-tabs__header {
border-bottom: 1px solid #03438b;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #03438b;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__nav {
border: 1px solid #03438b;
border-bottom: none;
border-radius: 4px 4px 0 0;
box-sizing: border-box;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__item {
border-left: 1px solid #234c9e;
}
.textBtn {
cursor: pointer;
}
.textBtn:hover {
color: #2a5dc2;
}
</style>

View File

@ -0,0 +1,444 @@
<template>
<div>
<div class="titleBox">
<div class="title">专业技能管理</div>
<div class="btnBox">
<el-button type="primary" @click="add">
<el-icon style="vertical-align: middle">
<CirclePlus />
</el-icon>
<span style="vertical-align: middle">新增</span>
</el-button>
<el-button @click="batchDelete" :disabled="ids.length == 0" typeof="danger">
<el-icon style="vertical-align: middle">
<Delete />
</el-icon>
<span style="vertical-align: middle">批量注销</span>
</el-button>
</div>
</div>
<div class="searchBox" ref="searchBox">
<el-form :model="form" :inline="true">
<el-form-item label="技能名称">
<el-input v-model="form.textName" placeholder="请输入技能名称" clearable style="width: 100%" />
</el-form-item>
<el-form-item>
<el-button @click="handleFilter"> 查询 </el-button>
<el-button @click="reset()"> 重置 </el-button>
</el-form-item>
</el-form>
</div>
<div class="tabBox">
<el-table :data="tableData" border row-key="id" :tree-props="{ children: 'itemList', hasChildren: true }"
style="width: 100%" @selection-change="handleSelectionChange" :height="tableHeight" :key="keyCount"
v-loading="loadingTable" element-loading-background="rgba(0,0,0,0.3)" element-loading-text="数据加载中。。">
<el-table-column type="selection" width="40" align="center" />
<el-table-column label="序号" type="index" align="center" sortable width="80" />
<el-table-column sortable prop="bqbh" show-overflow-tooltip align="center" width="250px" label="技能编号">
</el-table-column>
<el-table-column sortable prop="bqmc" show-overflow-tooltip align="center" width="350px" label="技能名称">
</el-table-column>
<el-table-column label="技能人数" align="center">
<template #default="{ row }">
<span class="textBtn" @click="info(row)">{{ row.xfllSl }}</span>
</template>
</el-table-column>
<el-table-column width="150" label="数据状态" align="center">
<template #default="{ row }">
<el-tag size="small" type="success" v-if="row.xtSjzt != 0">正常</el-tag>
<el-tag size="small" type="danger" v-else>注销</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200px">
<template #default="{ row }">
<el-button @click="update(row, 'detail')" size="small">详情</el-button>
<el-button @click="update(row, 'edit')" size="small" v-if="row.xtSjzt == 1">修改</el-button>
<el-button @click="delDictItem(row)" v-if="row.xtSjzt == 1" type="danger" size="small">注销</el-button>
</template>
</el-table-column>
</el-table>
<div class="fenye" :style="{ top: tableHeight + 'px' }">
<el-pagination class="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="form.current" :page-sizes="[10, 20, 50]" :page-size="form.size"
layout="total, sizes, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
<div v-if="dialogFormVisible" class="dialog">
<div class="head_box">
<span class="title">{{ title }}</span>
<div>
<el-button type="primary" size="small" @click="submit" v-if="!isDisabled" :loading="loading">保存</el-button>
<el-button size="small" @click="dialogFormVisible = false">关闭</el-button>
</div>
</div>
<el-form ref="elform" :rules="rules" :model="addForm" :inline="true" :disabled="isDisabled" label-position="top">
<el-form-item label="技能编号" prop="bqbh">
<el-input readonly v-model="addForm.bqbh" placeholder="请输入技能编号" style="width: 100%" />
</el-form-item>
<el-form-item label="技能名称" prop="bqmc">
<el-input v-model="addForm.bqmc" placeholder="请输入技能名称" clearable style="width: 100%" />
</el-form-item>
<div style="width: 100%" v-if="xfllActive">
<el-tabs style="width: 100%" v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="民警" name="mj"></el-tab-pane>
<el-tab-pane label="辅警" name="fj"></el-tab-pane>
</el-tabs>
<el-table :data="xfllDtata" border row-key="id" :tree-props="{ children: 'itemList', hasChildren: true }"
style="width: 100%" height="400px" :key="keyCount">
<el-table-column label="序号" type="index" align="center" sortable width="80" />
<el-table-column sortable prop="xm" show-overflow-tooltip align="center"
:label="activeName == 'mj' ? '民警姓名' : '辅警姓名'">
</el-table-column>
<el-table-column sortable prop="sfzh" show-overflow-tooltip align="center" label="身份证号码">
</el-table-column>
<el-table-column sortable prop="ssbm" label="所属部门" align="center"></el-table-column>
<el-table-column sortable prop="jh" label="警号" align="center"></el-table-column>
</el-table>
<el-pagination class="pagination" @size-change="handleSizeChangexf" @current-change="handleCurrentChangexf"
:current-page="xfllQuery.current" :page-sizes="[10, 20, 50]" :page-size="xfllQuery.size"
layout="total, sizes, prev, pager, next, jumper" :total="xfllTotal">
</el-pagination>
</div>
</el-form>
</div>
</div>
</template>
<script setup>
import PEO from "@/assets/images/body-bg.png";
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance } from "vue";
import { ElMessage } from "element-plus";
import {
getTbJcglBq,
getTbJcglXfll,
addTbJcglBq,
deleteTbJcglBq,
getTbJcglBqInfo,
updateTbJcglBqInfo
} from "@/api/xfll";
import { delTbJcglBq } from "@/api/basicsmanage/experience";
const xfllActive = ref(false);
const activeName = ref("mj");
const { proxy } = getCurrentInstance();
const searchBox = ref(null); // 搜索盒子
const loadingTable = ref(true);
const tableHeight = ref(); // 表格高度
const ids = ref([]); //批量注销的ID
const title = ref("新增专业技能");
//巡防力量数据
const xfllDtata = ref([]);
//巡防力量查询参数
const xfllQuery = ref({
current: 1,
size: 20,
fl: "01"
});
const xfllTotal = ref(0);
//查询参数
const form = ref({
current: 1,
size: 20,
textName: ""
});
//新增表单参数
const addForm = ref({
id: "",
bqbh: "",
bqmc: ""
});
//表单验证
const rules = reactive({
bqmc: [
{
required: true,
message: "请输入技能名称"
}
]
});
const tableData = ref([]); //表单数据
const total = ref(0); //总数据
const dialogFormVisible = ref(false); //是否打开新增弹窗
const elform = ref({}); //表当对象
const isDisabled = ref(false); //是否警用保存按钮
const loading = ref(false); //是否显示按钮加载
const checkAdd = ref(false);
const keyCount = ref(0); //tabel组件刷新值
onMounted(() => {
getListData();
tabHeightFn();
window.onresize = function () {
tabHeightFn();
};
proxy.mittBus.on("mittFn", (data) => {
keyCount.value = data;
});
});
onUnmounted(() => {
proxy.mittBus.off("mittFn");
});
function handleClick() {
if (activeName.value == "mj") {
xfllQuery.value.fl = "01";
getXfll();
} else {
xfllQuery.value.fl = "02";
getXfll();
}
}
//获取巡防力量数据
function getXfll() {
let data = {
fl: xfllQuery.value.fl,
pageSize: xfllQuery.value.size,
pageCurrent: xfllQuery.value.current,
bqId: xfllQuery.value.bqId || ""
};
getTbJcglXfll(data).then((res) => {
xfllDtata.value = res.records;
xfllTotal.value = res.total;
});
}
//查看详情
function setInfo(e) {
title.value = "专业技能技能详情";
getTbJcglBqInfo([e.id]).then((res) => {
addForm.value = res;
dialogFormVisible.value = true;
isDisabled.value = true;
});
}
//批量注销数据
const batchDelete = () => {
proxy
.$confirm("确定要注销", "警告", {
type: "warning"
})
.then(() => {
deleteTbJcglBq(ids.value).then((res) => {
ElMessage({
message: "注销成功",
type: "success"
});
getListData();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
};
//补0函数
function repairZero(num) {
let data = num;
if (1 <= num < 10) {
data = "000" + num;
} else if (10 <= num < 100) {
data = "00" + num;
} else if (100 <= num < 1000) {
data = "0" + num;
}
return data;
}
function add() {
xfllActive.value = false;
isDisabled.value = false;
checkAdd.value = true;
addForm.value = {
bqbh: "JN" + repairZero(total.value + 1),
bqmc: "",
bqlx: "SKL"
};
title.value = "新增专业技能";
dialogFormVisible.value = true;
}
//批量数据
const handleSelectionChange = (val) => {
ids.value = [];
if (val) {
val.forEach((item) => {
ids.value.push(item.id);
});
}
};
//新增提交
function submit() {
loading.value = true;
setTimeout(() => {
loading.value = false;
}, 1.5e3);
elform.value.validate((valid) => {
if (valid) {
let data = addForm.value;
if (!checkAdd.value) {
updateTbJcglBqInfo(data).then((res) => {
ElMessage({
message: "修改成功",
type: "success"
});
getListData();
});
} else {
addTbJcglBq(data).then((res) => {
ElMessage({
message: "添加成功",
type: "success"
});
getListData();
});
}
dialogFormVisible.value = false;
}
});
}
//点击查询
const handleFilter = () => {
form.value.current = 1;
getListData();
};
//获取数据
const getListData = () => {
loadingTable.value = true;
let data = {
pageSize: form.value.size,
pageCurrent: form.value.current,
bqmc: form.value.textName,
bqlx: "SKL"
};
getTbJcglBq(data)
.then((res) => {
tableData.value = res.records;
total.value = res.total;
loadingTable.value = false;
})
.catch(() => {
loadingTable.value = false;
});
};
//更改查询条数
function handleSizeChange(e) {
form.value.size = e;
form.value.current = 1;
getListData();
}
//分页查询
function handleCurrentChange(e) {
xfllQuery.value.current = e;
}
//更改查询条数xfll
function handleSizeChangexf(e) {
activeName.size = e;
xfllQuery.value.current = 1;
getXfll();
}
//分页查询xfll
function handleCurrentChangexf(e) {
xfllQuery.value.current = e;
getListData();
getXfll();
}
//修改技能
function update(e, type) {
isDisabled.value = type == "edit" ? false : true;
getTbJcglBqInfo(e.id).then((res) => {
addForm.value = res;
activeName.value = "mj";
xfllQuery.value.fl = "01";
title.value = type == "edit" ? "专业技能修改" : "专业技能详情";
checkAdd.value = false;
dialogFormVisible.value = true;
});
if (e.xfllSl == 0) {
xfllActive.value = false;
} else {
xfllActive.value = true;
xfllQuery.value.bqId = e.id;
getXfll();
}
}
function info(row) {
getTbJcglBqInfo(row.id).then((res) => {
addForm.value = res;
activeName.value = "mj";
xfllQuery.value.fl = "01";
title.value = "专业技能详情";
checkAdd.value = false;
isDisabled.value = true;
dialogFormVisible.value = true;
});
if (row.xfllSl == 0) {
xfllActive.value = false;
} else {
xfllActive.value = true;
xfllQuery.value.bqId = row.id;
getXfll();
}
}
//注销技能
function delDictItem(e) {
// 注销数据用
// delTbJcglBq(e.id).then((res) => {
proxy
.$confirm("确定要注销", "警告", {
type: "warning"
})
.then(() => {
deleteTbJcglBq([e.id]).then((res) => {
ElMessage({
message: "注销成功",
type: "success"
});
getListData();
});
})
.catch(() => {
proxy.$message.info("已取消");
});
}
//点击重置
const reset = () => {
form.value = {
current: 1,
size: 20,
textName: ""
};
getListData();
};
// 表格高度计算
const tabHeightFn = () => {
tableHeight.value = window.innerHeight - searchBox.value.offsetHeight - 240;
};
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
::v-deep .el-tabs--card>.el-tabs__header {
border-bottom: 1px solid #03438b;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #03438b;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__nav {
border: 1px solid #03438b;
border-bottom: none;
border-radius: 4px 4px 0 0;
box-sizing: border-box;
}
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__item {
border-left: 1px solid #234c9e;
}
.textBtn {
cursor: pointer;
}
.textBtn:hover {
color: #2a5dc2;
}
</style>