新增工作绩效

This commit is contained in:
2025-07-07 10:14:09 +08:00
parent 2d178ce75c
commit 23be579c8f
3 changed files with 366 additions and 1 deletions

View File

@ -432,7 +432,16 @@ export const publicRoutes = [
title: "重点人员预警模型", title: "重点人员预警模型",
icon: "article" icon: "article"
} }
} },
{
path: "/JobAppraisal",
name: "JobAppraisal",
component: () => import("@/views/backOfficeSystem/ExcavationResearch/JobAppraisal/index"),
meta: {
title: "社会员工工作信息考核",
icon: "article"
}
},
] ]
}, },
{ {

View File

@ -0,0 +1,185 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">社会信息员工工作考核{{ title }} </span>
<div>
<el-button type="primary" size="small" :loading="loading" @click="submit" >保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules"></FormMessage>
</div>
</div>
</template>
<script setup>
import { IdCard } from "@/utils/validate.js";
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
import * as rule from "@/utils/rules.js";
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, } from "vue";
const emit = defineEmits(["updateDate"]);
const props = defineProps({
dic: Object
});
const validateIdentity = () => {
return (rule, value, callback) => {
if (!value) {
return callback(new Error("身份证号不能为空"));
} else if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
callback(new Error("输入的身份证长度或格式错误"));
}
//身份证城市
var aCity = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外"
};
if (!aCity[parseInt(value?.substr(0, 2))]) callback(new Error("身份证地区非法"));
// 出生日期验证
var sBirthday = (
value.substr(6, 4) +
"-" +
Number(value.substr(10, 2)) +
"-" +
Number(value.substr(12, 2))
).replace(/-/g, "-"),
d = new Date(sBirthday);
let yyyy = d.getFullYear();
let mm = d.getMonth() + 1;
let dd = d.getDate();
if (sBirthday !== yyyy + "-" + mm + "-" + dd) {
listQuery.value.ryCsrq = "";
callback(new Error("身份证上的出生日期非法"));
} else {
let month = mm < 10 ? "0" + mm : mm;
listQuery.value.ryCsrq = yyyy + "-" + month + "-" + dd;
}
// 身份证号码校验
var sum = 0,
weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
codes = "10X98765432";
for (var i = 0; i < value.length - 1; i++) {
sum += value[i] * weights[i];
}
var last = codes[sum % 11]; //计算出来的最后一位身份证号码
if (value[value.length - 1] !== last) {
listQuery.value.ryXb = "";
callback(new Error("输入的身份证号非法"));
} else {
if (value.length === 18) {
listQuery.value.ryCsrq = IdCard(value, 1);
listQuery.value.ryXb =
parseInt(value.substr(16, 1)) % 2 === 1 ? "1" : "2";
}
}
callback();
};
};
const { proxy } = getCurrentInstance();
const dialogForm = ref(false); //弹窗
const formData = ref([
{ label: "管辖部门", prop: "gxbmDm", type: "department" },
{ label: "姓名", prop: "ryXm", type: "input" },
{ label: "联系电话", prop: "ryLxdh", type: "input" },
{ label: "身份证号", prop: "rySfzh", type: "input" },
{ label: "出生日期", prop: "ryCsrq", type: "date" },
{ label: "性别", prop: "ryXb", type: "select", options: props.dic.D_BZ_XB },
{ label: "民族", prop: "ryMz", type: "select", options: props.dic.D_BZ_MZ },
{ label: "学历", prop: "ryXl", type: "select", options: props.dic.D_BZ_WHCD },
{ label: "政治面貌", prop: "ryZzmm", type: "select", options: props.dic.D_BZ_ZZMM},
{ label: "所在单位", prop: "rySzdw", type: "input" },
{ label: "居住地地址", prop: "jzdDz", type: "textarea", width: "100%" },
{ label: "考核分数", prop: "khfs", type: "input" },
{ label: "奖惩类型", prop: "jclx", type: "select", options: props.dic.D_GS_RLQB_JCQK},
{ label: "奖励情况说明", prop: "jlqksm", type: "textarea", width: "100%" },
]);
const listQuery = ref({}); //表单
const loading = ref(false);
const elform = ref();
const title = ref("");
const rules = reactive({
gxbmDm: [{ required: true, message: "请选择管辖部门", trigger: "change" }],
ryXm: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
rySfzh: [
{ required: true, message: "请输入人员身份证号", trigger: ["blur", "change"]},
{ trigger: ["blur", "change"], validator: validateIdentity() }
],
...rule.phoneRule({ require: true, validator: true }, "ryLxdh") // 是否必填 是否进行校验 可以传第二个参数
});
// 初始化数据
const init = (type, row) => {
dialogForm.value = true;
title.value = type == "add" ? "新增" : "编辑";
if (row) getDataById(row.id);
};
// 根据id查询详情
const getDataById = (id) => {
qcckGet({}, "/mosty-gsxt/tbJlqk/selectByid" + id).then((res) => {
listQuery.value = res;
});
};
// 提交
const submit = () => {
elform.value.submit((data) => {
let url = title.value == "新增" ? "/mosty-gsxt/tbJlqk/add" : "/mosty-gsxt/tbJlqk/update";
let params = { ...data };
loading.value = true;
qcckPost(params, url).then(() => {
loading.value = false;
proxy.$message({ type: "success", message: title.value + "成功" });
emit("updateDate");
close();
}).catch(() => {loading.value = false;});
});
};
// 关闭
const close = () => {
listQuery.value = {};
dialogForm.value = false;
loading.value = false;
};
defineExpose({ init });
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
</style>

View File

@ -0,0 +1,171 @@
<template>
<div>
<div class="titleBox">
<PageTitle title="社会信息员工工作考核">
<el-button type="primary" @click="addEdit('add', '')">
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
<span style="vertical-align: middle">新增</span>
</el-button>
</PageTitle>
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" />
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable
:tableData="pageData.tableData"
:tableColumn="pageData.tableColumn"
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth"
>
<template #ryXb="{ row }">
<DictTag :tag="false" :value="row.ryXb" :options="D_BZ_XB" />
</template>
<template #ryXl="{ row }">
<DictTag :tag="false" :value="row.ryXl" :options="D_BZ_WHCD" />
</template>
<template #ryMz="{ row }">
<DictTag :tag="false" :value="row.ryMz" :options="D_BZ_MZ" />
</template>
<template #jclx="{ row }">
<DictTag :tag="false" :value="row.jclx" :options="D_GS_RLQB_JCQK" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
<el-link size="small" type="success" @click="addEdit('edit', row)">编辑</el-link >
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
</template>
</MyTable>
<Pages
@changeNo="changeNo"
@changeSize="changeSize"
:tableHeight="pageData.tableHeight"
:pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"
/>
</div>
<!-- 详情 -->
<DetailForm v-if="show" @updateDate="getList" ref="detailDiloag" :dic="{ D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM,D_GS_RLQB_JCQK }"
/>
</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 DetailForm from "./components/addForm.vue";
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance();
const { D_GS_RLQB_JCQK,D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM } = proxy.$dict("D_GS_RLQB_JCQK","D_BZ_WHCD","D_BZ_MZ","D_BZ_XB","D_BZ_ZZMM"); //获取字典数据
const detailDiloag = ref();
const searchBox = ref(); //搜索框
const show = ref(false);
const searchConfiger = ref([
{ label: "姓名", prop: "ryXm", placeholder: "请输入姓名", showType: "input" },
{ label: "身份证号", prop: "rySfzh", placeholder: "请输入身份证号", showType: "input"}
]);
const pageData = reactive({
tableData: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 200,
tableColumn: [
{ label: "姓名", prop: "ryXm" },
{ label: "性别", prop: "ryXb",showSolt: true },
{ label: "民族", prop: "ryMz",showSolt: true },
{ label: "学历", prop: "ryXl",showSolt: true },
{ label: "身份证", prop: "rySfzh"},
{ label: "所在单位", prop: "rySzdw"},
{ label: "考核分数", prop: "khfs" },
{ label: "奖惩类型", prop: "jclx",showSolt: true },
{ label: "奖励情况说明", prop: "jlqksm" }
]
});
const queryFrom = ref({});
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-gsxt/tbJlqk/selectPage").then((res) => {
pageData.tableData = res.records || [];
pageData.total = res.total;
pageData.tableConfiger.loading = false;
}).catch(() => {
pageData.tableConfiger.loading = false;
});
};
// 删除
const deleteRow = (id) => {
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
qcckPost({}, "/mosty-gsxt/tbJlqk/delete/" + id).then(() => {
proxy.$message({ type: "success", message: "删除成功" });
getList();
});
})
};
// 详情
const addEdit = (type, row) => {
show.value = true;
nextTick(() => {
detailDiloag.value.init(type, 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>