特种作业人员

pull/1/head
chenxinying 2024-02-21 11:18:02 +08:00
parent f645b8fbe8
commit 7e8ac114fe
3 changed files with 38 additions and 31 deletions

View File

@ -1,16 +1,16 @@
import { post } from "@/request/axios.js"; import { post } from "@/request/axios.js";
export const getPersonnelManagementList = (params) => export const getPersonnelManagementList = (params) =>
post("/personnelmanagement/list", params); // 特种作业人员管理列表 post("/specialoperations/list", params); // 特种作业人员管理列表
export const getPersonnelManagementView = (params) => export const getPersonnelManagementView = (params) =>
post("/personnelmanagement/goEdit", params); // 特种作业人员管理查看 post("/specialoperations/goEdit", params); // 特种作业人员管理查看
export const setPersonnelManagementDelete = (params) => export const setPersonnelManagementDelete = (params) =>
post("/personnelmanagement/delete", params); // 特种作业人员管理删除 post("/specialoperations/delete", params); // 特种作业人员管理删除
export const setPersonnelManagementDeleteBatch = (params) => export const setPersonnelManagementDeleteBatch = (params) =>
post("/personnelmanagement/deleteAll", params); // 特种作业人员管理批量删除 post("/specialoperations/deleteAll", params); // 特种作业人员管理批量删除
export const setPersonnelManagementAdd = (params) => export const setPersonnelManagementAdd = (params) =>
post("/personnelmanagement/add", params); // 特种作业人员管理批量添加 post("/specialoperations/add", params); // 特种作业人员管理批量添加
export const setPersonnelManagementEdit = (params) => export const setPersonnelManagementEdit = (params) =>
post("/personnelmanagement/edit", params); // 特种作业人员管理批量修改 post("/specialoperations/edit", params); // 特种作业人员管理批量修改
export const getVerifyDeduplicationCertificateNum = (params) => export const getVerifyDeduplicationCertificateNum = (params) =>
post("/personnelmanagement/hasCertificate", params); // 特种作业证书编号验证 post("/specialoperations/hasCertificate", params); // 特种作业证书编号验证

View File

@ -91,15 +91,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特种作业证书有效期" prop="VALID_TIME"> <el-form-item label="证书到期时间" prop="VALID_ETIME">
<el-date-picker <el-date-picker
v-model="form.VALID_TIME" v-model="form.VALID_ETIME"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:disabled-date="fnDisabledDate"
type="date"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -131,7 +129,7 @@ import { getUnitsListAll } from "@/request/keyprojects.js";
const userStore = useUserStore(); const userStore = useUserStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const { PERSONNELMANAGEMENT_ID } = route.query; const { SPECIALOPERATIONS_ID } = route.query;
const CORP_NAME = userStore.getUserInfo.CORP_NAME; const CORP_NAME = userStore.getUserInfo.CORP_NAME;
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID; const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
const typeList = [ const typeList = [
@ -142,6 +140,10 @@ const sexList = [
{ ID: "0", NAME: "男" }, { ID: "0", NAME: "男" },
{ ID: "1", NAME: "女" }, { ID: "1", NAME: "女" },
]; ];
const fnDisabledDate = (time) => {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
};
const personnelManagementJobTypeList = const personnelManagementJobTypeList =
await layoutFnGetPersonnelManagementJobType(); await layoutFnGetPersonnelManagementJobType();
const { list: unitsNameList } = useListData(getUnitsListAll); const { list: unitsNameList } = useListData(getUnitsListAll);
@ -149,7 +151,7 @@ const fnHasCertificate = async (rule, value, callback) => {
if (value) { if (value) {
const resData = await getVerifyDeduplicationCertificateNum({ const resData = await getVerifyDeduplicationCertificateNum({
CERTIFICATE_NUM: value, CERTIFICATE_NUM: value,
PERSONNELMANAGEMENT_ID, SPECIALOPERATIONS_ID,
}); });
if (resData.msg) callback(new Error(resData.msg)); if (resData.msg) callback(new Error(resData.msg));
else callback(); else callback();
@ -179,6 +181,13 @@ const rules = {
message: "请输入正确的手机号码", message: "请输入正确的手机号码",
}, },
], ],
VALID_ETIME: [
{
required: true,
message: "特种作业证书到期时间不能为空",
trigger: "change",
},
],
IDENTITYCARD: [ IDENTITYCARD: [
{ {
pattern: pattern:
@ -198,16 +207,15 @@ const form = ref({
PHONENUM: "", PHONENUM: "",
IDENTITYCARD: "", IDENTITYCARD: "",
LICENSING: "", LICENSING: "",
VALID_TIME: [], VALID_ETIME: [],
}); });
const formRef = ref(null); const formRef = ref(null);
const fnGetData = async () => { const fnGetData = async () => {
if (!PERSONNELMANAGEMENT_ID) return; if (!SPECIALOPERATIONS_ID) return;
const resData = await getPersonnelManagementView({ const resData = await getPersonnelManagementView({
PERSONNELMANAGEMENT_ID, SPECIALOPERATIONS_ID,
}); });
form.value = resData.pd; form.value = resData.pd;
form.value.VALID_TIME = [resData.pd.VALID_STIME, resData.pd.VALID_ETIME];
}; };
fnGetData(); fnGetData();
const fnSubmit = debounce( const fnSubmit = debounce(
@ -218,10 +226,9 @@ const fnSubmit = debounce(
...form.value, ...form.value,
UNITS_ID: UNITS_ID:
form.value.PTYPE === "公司员工" ? CORPINFO_ID : form.value.UNITS_ID, form.value.PTYPE === "公司员工" ? CORPINFO_ID : form.value.UNITS_ID,
VALID_STIME: form.value.VALID_TIME[0], VALID_ETIME: form.value.VALID_ETIME,
VALID_ETIME: form.value.VALID_TIME[1],
}; };
!PERSONNELMANAGEMENT_ID !SPECIALOPERATIONS_ID
? await setPersonnelManagementAdd(params) ? await setPersonnelManagementAdd(params)
: await setPersonnelManagementEdit(params); : await setPersonnelManagementEdit(params);
ElMessage.success("提交成功"); ElMessage.success("提交成功");

View File

@ -51,7 +51,7 @@
<layout-table <layout-table
ref="tableRef" ref="tableRef"
v-model:pagination="pagination" v-model:pagination="pagination"
row-key="PERSONNELMANAGEMENT_ID" row-key="SPECIALOPERATIONS_ID"
:data="list" :data="list"
@get-data="fnGetData" @get-data="fnGetData"
> >
@ -65,8 +65,8 @@
<el-table-column label="单位名称"> <el-table-column label="单位名称">
<template #default="{ row }"> <template #default="{ row }">
{{ {{
row.PERSONNELMANAGEMENT_ID === CORPINFO_ID row.UNITS_ID === CORPINFO_ID
? CORP_NAME ? row.CREATOR_CORP_NAME
: row.UNITS_NAME : row.UNITS_NAME
}} }}
</template> </template>
@ -87,7 +87,7 @@
@click=" @click="
router.push({ router.push({
path: '/special_operations/personnel_management/edit', path: '/special_operations/personnel_management/edit',
query: { PERSONNELMANAGEMENT_ID: row.PERSONNELMANAGEMENT_ID }, query: { SPECIALOPERATIONS_ID: row.SPECIALOPERATIONS_ID },
}) })
" "
> >
@ -98,7 +98,7 @@
type="primary" type="primary"
text text
link link
@click="fnDelete(row.PERSONNELMANAGEMENT_ID)" @click="fnDelete(row.SPECIALOPERATIONS_ID)"
> >
删除 删除
</el-button> </el-button>
@ -158,9 +158,9 @@ const personnelManagementJobTypeList =
await layoutFnGetPersonnelManagementJobType(); await layoutFnGetPersonnelManagementJobType();
const fnDelete = debounce( const fnDelete = debounce(
1000, 1000,
async (PERSONNELMANAGEMENT_ID) => { async (SPECIALOPERATIONS_ID) => {
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" }); await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setPersonnelManagementDelete({ PERSONNELMANAGEMENT_ID }); await setPersonnelManagementDelete({ SPECIALOPERATIONS_ID });
ElMessage.success("删除成功"); ElMessage.success("删除成功");
fnResetPagination(); fnResetPagination();
}, },
@ -175,7 +175,7 @@ const fnDeleteAll = debounce(
return; return;
} }
const DATA_IDS = selectionData const DATA_IDS = selectionData
.map((item) => item.PERSONNELMANAGEMENT_ID) .map((item) => item.SPECIALOPERATIONS_ID)
.join(","); .join(",");
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" }); await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setPersonnelManagementDeleteBatch({ DATA_IDS }); await setPersonnelManagementDeleteBatch({ DATA_IDS });